home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pbclon21.zip / PBCLONE.MAN < prev    next >
Text File  |  1993-01-12  |  386KB  |  11,780 lines

  1.        PBClone 2.1  (c) 1990-1993  Thomas G. Hanlin III
  2.  
  3. Name  : AddMatI              (Add Matrix Integer)
  4. Class : Array management
  5. Level : Any
  6.  
  7. This routine adds an integer to as many elements of an integer
  8. array as you like, starting at a specified place in the array.
  9. It can also be used to subtract (just specify a negative
  10. value).  If there was a numeric overflow at any point in the
  11. operation, an error code will be returned.
  12.  
  13.    AddMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  14.  
  15. DSeg%      segment of the first array element to add
  16. DOfs%      offset of the first array element to add
  17. Elements%  number of array elements to which to add
  18. Value%     value to add to each array element
  19. -------
  20. ErrCode%   error code: 0 if no error
  21.  
  22. Name  : AddMatL              (Add Matrix Long integer)
  23. Class : Array management
  24. Level : Any
  25.  
  26. This routine adds a long integer to as many elements of an long
  27. integer array as you like, starting at a specified place in the
  28. array.  It can also be used to subtract (just specify a
  29. negative value).  If there was a numeric overflow at any point
  30. in the operation, an error code will be returned.
  31.  
  32.    AddMatL DSeg%, DOfs%, Elements%, Value&, ErrCode%
  33.  
  34. DSeg%      segment of the first array element to add
  35. DOfs%      offset of the first array element to add
  36. Elements%  number of array elements to which to add
  37. Value&     value to add to each array element
  38. -------
  39. ErrCode%   error code: 0 if no error
  40.  
  41. Name  : AllExtMem&           (All Extended Memory)
  42. Class : Equipment
  43. Level : Clone (AT)
  44.  
  45. This routine returns the amount of extended memory installed in
  46. the system, as reported by the power-on self-test (POST)
  47. routine at boot time.  This does not tell you how much extended
  48. memory is actually available, since extended memory may be
  49. carved up by users of BIOS-level extended memory or XMS memory,
  50. converted to expanded memory, etc.  It only tells you the
  51. amount of physical extended memory that is installed.
  52.  
  53. Do not use this routine on PC/XT machines. It is only for
  54. AT-class computers.
  55.  
  56.    TotalKb& = AllExtMem&
  57.  
  58. -------
  59. TotalKb&      kilobytes of extended memory installed
  60.  
  61. Name  : AltKey               (Alt Key)
  62. Class : Input
  63. Level : Any
  64.  
  65. This routine works in conjunction with a key input routine,
  66. such as INKEY$ or the CheckKey and GetKey routines.  Given the
  67. ASCII code and scan code of a key, AltKey returns the
  68. associated key letter, if any.  For instance, it returns "A" if
  69. you pass it ASCII code 0 and scan code 30, because those codes
  70. represent Alt-A.
  71.  
  72.    AltKey ASCIICode%, ScanCode%, Ky$
  73.  
  74. ASCIICode%   ASCII code of the key
  75. ScanCode%    scan code of the key
  76. -------
  77. Ky$          associated key letter ("" if none)
  78.  
  79. Name  : AndSt                (AND String)
  80. Class : String
  81. Level : Any
  82.  
  83. This routine ANDs each byte in one string with the
  84. corresponding byte in a second string.  The strings must be the
  85. same length.
  86.  
  87.    AndSt St1$, St2$
  88.  
  89. St1$      string to AND
  90. St2$      string to AND with
  91. -------
  92. St1$      result
  93.  
  94. Name  : Any2Dec              (Any to Decimal)
  95. Class : Numeric
  96. Level : Any
  97.  
  98. This routine converts a number in any base to a normal (base
  99. 10) integer.  It works like the &H and &O prefixes in BASIC,
  100. but rather than working only in hexadecimal (base 16) and octal
  101. (base 8), it can be used for binary, octal, or almost anything
  102. else.  The base may range from 2-35.
  103.  
  104. The input number may be in either signed or unsigned integer
  105. form, and will be converted to a signed integer.  For example,
  106. the base 16 (hexadecimal) number FFFF would be converted to -1,
  107. as would the base 10 (decimal) number 65535.  This may not seem
  108. to make sense if you're not familiar with the internal format
  109. for integers, but is the standard approach to converting
  110. unsigned numbers (0-65535) to signed numbers (-32768 to 32767).
  111. BASIC always uses signed integers, so the numbers will always
  112. be what you expect so long as they are kept in the range -32768
  113. to 32767.  They "wrap around" for 32768 to 65535.
  114.  
  115. The most common bases used on computers are base 2 (binary),
  116. base 8 (octal), base 10 (decimal), and base 16 (hexadecimal).
  117.  
  118.    Any2Dec Number$, NrBase%, DecNr%, ErrCode%
  119.  
  120. Number$   any-base number to convert to an integer
  121. NrBase%   number base to convert from
  122. -------
  123. DecNr%    resulting integer
  124. ErrCode%  error code: 0 if no error
  125.  
  126. Name  : AscI%                (ASC Integer)
  127. Class : String
  128. Level : Any
  129.  
  130. This is a replacement for the ASC function provided by BASIC.
  131. It is smaller than ASC, however, and also somewhat faster.
  132.  
  133. Unlike BASIC or ProBas, the PBClone AscI function returns -1 as
  134. an error condition if you try to use it on a null string.  This
  135. convention owes its origin to the similar routine in Crescent's
  136. libraries.
  137.  
  138. See also AscM%, which returns the ASCII code of a character at
  139. a specific location within a string.
  140.  
  141.    Value% = AscI%(St$)
  142.  
  143. St$        string for which to return ASCII code
  144. -------
  145. Value%     code of the first string char or -1 if null string
  146.  
  147. Name  : AscM%                (ASC MID$)
  148. Class : String
  149. Level : Any
  150.  
  151. This function works like a combination of the BASIC functions
  152. ASC and MID$.  It returns the ASCII code of a character at a
  153. specified position in a string.  If the specified position is
  154. outside the string, -1 will be returned.
  155.  
  156. See also AscI%, which returns the ASCII code of the character
  157. at the beginning of a string.
  158.  
  159.    Value% = AscM%(St$, Posn%)
  160.  
  161. St$        string to examine
  162. Posn%      character position to examine
  163. -------
  164. Value%     code of the specified character or -1 if error
  165.  
  166. Name  : BarMenu              (Bar Menu)
  167. Class : Input
  168. Level : Clone
  169.  
  170. This is a bar menu routine.  It allows the user to select one
  171. of a list of items given on a single menu row or "bar".  The
  172. current item is highlighted in your choice of colors; user
  173. selection can be done either by moving this highlight and
  174. pressing return or by entering the letter associated with the
  175. desired item.  Only text mode is supported.
  176.  
  177. The highlight may be moved with the left and right arrow keys,
  178. tab and backtab, or space and backspace.  Selection is done
  179. with <CR>, the enter key.
  180.  
  181. The letter used to select an item is the first character of the
  182. item that is not lowercase or a space.  If the item is all
  183. lowercase, the first character of the item will be used.  For
  184. example, suppose you want the user to select one of "list" or
  185. "log".  By passing the options to BarMenu as "List" and "lOg",
  186. you allow the user to press "L" for "List" and "O" for "lOg".
  187.  
  188. The user's choice will be returned to you as a number, with the
  189. first choice being numbered 1.  If <ESC> was pressed, 0 will be
  190. returned.
  191.  
  192.    BarMenu Pick$(), Row%, LCol%, RCol%, VAttr%, HiAttr%, Prompt$
  193.  
  194. Pick$()       list of items to choose from
  195. Row%          row on which to display the bar
  196. LCol%         leftmost column of the bar
  197. RCol%         rightmost column of the bar (use -1 for autosize)
  198. VAttr%        bar color/attribute (see CalcAttr)
  199. HiAttr%       bar highlight color/attribute (see CalcAttr)
  200. Prompt$       prompt text (displayed at left side of the bar)
  201. -------
  202. Row%          # of the chosen item (1-items, or 0 if <ESC>)
  203.  
  204. Name  : BarMenuM             (Bar Menu with Mouse)
  205. Class : Input, Mouse
  206. Level : Clone
  207.  
  208. This is a bar menu routine.  It functions just like BarMenu,
  209. but supports the use of a mouse as well as the keyboard.  Make
  210. sure the mouse cursor is visible before calling this routine!
  211.  
  212.    BarMenuM PickList$(), Row%, LeftCol%, RightCol%, VAttr%, _
  213.       HiAttr%, Prompt$, Mouse%, ShowCursor%
  214.  
  215. PickList$()   list of items to choose from
  216. Row%          row on which to display the bar
  217. LeftCol%      leftmost column of the bar
  218. RightCol%     rightmost column of the bar (use -1 for auto-sizing)
  219. VAttr%        bar color/attribute (see CalcAttr)
  220. HiAttr%       bar highlight color/attribute (see CalcAttr)
  221. Prompt$       prompt text (displayed at the left side of the bar)
  222. Mouse%        whether a mouse is available (0 no)
  223. ShowCursor%   not used
  224. -------
  225. Row%          number of the chosen item (1-items, or 0 if <ESC>)
  226.  
  227. Name  : Bickel               (Bickel comparison)
  228. Class : String
  229. Level : Any
  230.  
  231. A string comparison routine, Bickel allows you to see how
  232. closely two strings match.  The better the match, the larger
  233. the returned value will be.  Since there is no constant minimum
  234. or maximum value, this routine is best used for applications
  235. involving dictionary searches.  You would scan the dictionary
  236. and make a list of the best matches.  This is appropriate for a
  237. spelling checker, for instance.
  238.  
  239.    Bickel St1$, St2$, Result%
  240.  
  241. St1$      first string to compare
  242. St2$      second string to compare
  243. -------
  244. Result%   resulting "match magnitude" value
  245.  
  246. Name  : BigPrint             (Big Print)
  247. Class : Display
  248. Level : BIOS
  249.  
  250. As the name suggests, this routine displays text in large
  251. characters.  How large?  Eight times as high and as wide as
  252. normal!  Each "big character" will be composed of many
  253. normal-sized characters.  You may choose the normal character
  254. used to create the big characters (the default is a CHR$(219)
  255. solid block character, if you pass a null string here).
  256.  
  257. You should avoid using CHR$(128) to CHR$(255) when in either of
  258. the CGA graphics modes, as many CGAs are unable to display
  259. these characters when in graphics mode.
  260.  
  261.    BigPrint St$, FormCh$, Row%, Column%, VAttr%
  262.  
  263. St$       string to display in big characters
  264. FormCh$   character used to compose the big characters
  265. Row%      starting row
  266. Column%   starting column
  267. VAttr%    color/attribute of big characters (see CalcAttr)
  268.  
  269. Name  : BinSeekD             (Binary Seek Double precision)
  270. Class : Array management
  271. Level : Any
  272.  
  273. This routine uses binary search techniques to locate a specific
  274. number in a sorted double-precision array.  Each number in the
  275. array must be unique (no duplicates) for this to work.  This is
  276. a very, very fast routine and is especially handy for look-up
  277. tables.
  278.  
  279. The array is expected to begin at element 1.  You may specify
  280. the maximum element to search, allowing use of only part of an
  281. array.
  282.  
  283. A single number is returned in Posn%.  If Posn% is greater than
  284. zero, the target number was found and Posn% is the position in
  285. the array where it was found.  If Posn% is negative, the target
  286. number was not found, but it could be inserted into the array
  287. at the -Posn% element.  If the number is zero, the target
  288. number was not found and there is no room in the array to add
  289. any more values.
  290.  
  291.    BinSeekD Array#(), Elements%, Target#, Posn%
  292.  
  293. Array#()    array of sorted, unique values to search
  294. Elements%   maximum array element to search
  295. Target#     value to look for
  296. -------
  297. Posn%       whether and where the target was found (see above)
  298.  
  299. Name  : BinSeekI             (Binary Seek Integer)
  300. Class : Array management
  301. Level : Any
  302.  
  303. This routine uses binary search techniques to locate a specific
  304. number in a sorted integer array.  Each number in the array
  305. must be unique (no duplicates) for this to work.  This is a
  306. very, very fast routine and is especially handy for look-up
  307. tables.
  308.  
  309. The array is expected to begin at element 1.  You may specify
  310. the maximum element to search, allowing use of only part of an
  311. array.
  312.  
  313. A single number is returned in Posn%.  If Posn% is greater than
  314. zero, the target number was found and Posn% is the position in
  315. the array where it was found.  If Posn% is negative, the target
  316. number was not found, but it could be inserted into the array
  317. at the -Posn% element.  If the number is zero, the target
  318. number was not found and there is no room in the array to add
  319. any more values.
  320.  
  321.    BinSeekI Array%(), Elements%, Target%, Posn%
  322.  
  323. Array%()    array of sorted, unique values to search
  324. Elements%   maximum array element to search
  325. Target%     value to look for
  326. -------
  327. Posn%       whether and where the target was found (see above)
  328.  
  329. Name  : BinSeekL             (Binary Seek Long integer)
  330. Class : Array management
  331. Level : Any
  332.  
  333. This routine uses binary search techniques to locate a specific
  334. number in a sorted long integer array.  Each number in the
  335. array must be unique (no duplicates) for this to work.  This is
  336. a very, very fast routine and is especially handy for look-up
  337. tables.
  338.  
  339. The array is expected to begin at element 1.  You may specify
  340. the maximum element to search, allowing use of only part of an
  341. array.
  342.  
  343. A single number is returned in Posn%.  If Posn% is greater than
  344. zero, the target number was found and Posn% is the position in
  345. the array where it was found.  If Posn% is negative, the target
  346. number was not found, but it could be inserted into the array
  347. at the -Posn% element.  If the number is zero, the target
  348. number was not found and there is no room in the array to add
  349. any more values.
  350.  
  351.    BinSeekL Array&(), Elements%, Target&, Posn%
  352.  
  353. Array&()    array of sorted, unique values to search
  354. Elements%   maximum array element to search
  355. Target&     value to look for
  356. -------
  357. Posn%       whether and where the target was found (see above)
  358.  
  359. Name  : BinSeekS             (Binary Seek Single precision)
  360. Class : Array management
  361. Level : Any
  362.  
  363. This routine uses binary search techniques to locate a specific
  364. number in a sorted single-precision array.  Each number in the
  365. array must be unique (no duplicates) for this to work.  This is
  366. a very, very fast routine and is especially handy for look-up
  367. tables.
  368.  
  369. The array is expected to begin at element 1.  You may specify
  370. the maximum element to search, allowing use of only part of an
  371. array.
  372.  
  373. A single number is returned in Posn%.  If Posn% is greater than
  374. zero, the target number was found and Posn% is the position in
  375. the array where it was found.  If Posn% is negative, the target
  376. number was not found, but it could be inserted into the array
  377. at the -Posn% element.  If the number is zero, the target
  378. number was not found and there is no room in the array to add
  379. any more values.
  380.  
  381.    BinSeekS Array!(), Elements%, Target!, Posn%
  382.  
  383. Array!()    array of sorted, unique values to search
  384. Elements%   maximum array element to search
  385. Target!     value to look for
  386. -------
  387. Posn%       whether and where the target was found (see above)
  388.  
  389. Name  : BinSeekSt            (Binary Seek String)
  390. Class : Array management
  391. Level : Any
  392.  
  393. This routine uses binary search techniques to locate a specific
  394. string in a sorted string array.  Each string in the array must
  395. be unique (no duplicates) for this to work.  This is a very,
  396. very fast routine and is especially handy for look-up tables.
  397.  
  398. The string array is expected to begin at element 1.  You may
  399. specify the maximum element to search, allowing use of only
  400. part of an array.  You must specify whether capitalization
  401. matters-- set CapsCount% to 0 if it doesn't.
  402.  
  403. A single number is returned in Posn%.  If the number is greater
  404. than zero, the target string was found, and the number is the
  405. position in the array where it was found.  If the number is
  406. negative, the target string was not found, but it could be
  407. inserted into the array at the -Posn% element.  If the number
  408. is zero, the target string was not found and there is no room
  409. in the array to add any more values.
  410.  
  411.    BinSeekSt Array$(), Elements%, Target$, CapsCount%, Posn%
  412.  
  413. Array$()    array of sorted, unique values to search
  414. Elements%   maximum array element to search
  415. Target$     string to look for
  416. CapsCount%  0 if capitalization doesn't matter
  417. -------
  418. Posn%       whether and where the target was found (see above)
  419.  
  420. Name  : BIOSInkey            (BIOS INKEY$)
  421. Class : Input
  422. Level : BIOS
  423.  
  424. BIOSInkey works like INKEY$, but it gets its key directly by
  425. asking the BIOS. The primary advantage of this is that you get
  426. the "scan" code as well as the ASCII code of the key.  The scan
  427. code is independent of the shift status-- for instance, the
  428. scan code for "A" is the same as the scan code for "a" or
  429. Control-A or Alt-A.  This can be very handy.
  430.  
  431. If there is no key available, both the scan code and ASCII code
  432. will be zero.
  433.  
  434.    BIOSInkey AscCode%, ScanCode%
  435.  
  436. -------
  437. AscCode%    ASCII code of the key, if any
  438. ScanCode%   scan code of the key, if any
  439.  
  440. Name  : BkScroll             (Backward Scroll)
  441. Class : Display
  442. Level : BIOS
  443.  
  444. This routine scrolls any selected part of the display down-- it
  445. does a backwards scroll.  You may scroll as many times as you
  446. like, or scroll "zero" times to totally clear the selected part
  447. of the display.
  448.  
  449. Note that BIOS-level scrolling can cause the screen to flicker
  450. on some CGAs due to a combination of unfortunate design factors.
  451.  
  452.    BkScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  453.  
  454. TopRow%      top row of the area to scroll
  455. LeftCol%     left column of the area to scroll
  456. BottomRow%   top row of the area to scroll
  457. RightCol%    left column of the area to scroll
  458. Times%       number of times (or rows) to scroll
  459.  
  460. Name  : BkSpace              (Backspace)
  461. Class : Display
  462. Level : BIOS
  463.  
  464. Although CHR$(8) is supposed to mean "backspace", it shows up
  465. as a graphics character when BASIC prints it.  This routine
  466. does an actual backspace with full wrap-- if it's at the
  467. beginning of the line, it will move back to the previous line
  468. (if there is one).  It backspaces destructively (erasing the
  469. previous character) from the current cursor position.  The new
  470. cursor is returned to you, since QuickBASIC may ignore the new
  471. status.
  472.  
  473.    BkSpace Row%, Column%       ' do the backspace
  474.    LOCATE Row%, Column%        ' inform QuickBASIC
  475.  
  476. -------
  477. Row%      new row
  478. Column%   new column
  479.  
  480. Name  : Blink                (Blink toggle)
  481. Class : Display
  482. Level : BIOS / Clone (see text)
  483.  
  484. It is possible to make characters in text mode blink by giving
  485. them an appropriate "color".  I wouldn't mention something so
  486. obvious but for another possibility which is less widely known:
  487. blinking can be turned off, in which case the characters that
  488. would have otherwise blinked will instead have a bright
  489. background.  In other words, turn off blinking, and you double
  490. the possible number of background colors.
  491.  
  492. This technique will always work with EGA and VGA displays.  It
  493. can also be used with MDA/Hercules and CGA displays, on which
  494. it will almost always work... unfortunately, on some
  495. less-than-perfect PC clones, it will cause the computer to lock
  496. up instead.  So, be careful with this one!
  497.  
  498.    Blink SetBlink%
  499.  
  500. SetBlink%    use blink (-1) or intense backgrounds (0)
  501.  
  502. Name  : BlockMove            (Block memory Move)
  503. Class : Memory
  504. Level : Clone
  505.  
  506. This routine allows you to copy or "move" a block of data from
  507. one memory location to another.  It isn't very bright, so if
  508. the memory areas overlap, you will have to tell the routine to
  509. "move backwards" instead of forwards. In that case, you will
  510. also have to change the offsets to point to the ends of the
  511. memory areas instead of the beginnings.
  512.  
  513. Normally, you can use forward moves.  In that case, the offsets
  514. you specify are those of the beginning of the memory areas.  If
  515. backward moves are required, the offsets specified are those of
  516. the end of the memory areas.
  517.  
  518. If you are familiar with assembly language, you may recognize
  519. this as a straightforward implementation of the "REP MOVSB"
  520. instruction.
  521.  
  522. You may move up to 65,520 bytes at a time, provided that the
  523. addresses are in normalized form (if you don't know what this
  524. means, you probably don't need to worry about it).
  525.  
  526. This routine can be used to copy information to an array from
  527. any area of memory (the BIOS data area, the screen, another
  528. array, etc), or vice versa. It can also be used to do things
  529. like insert/delete elements from an array, scroll the screen,
  530. fill the screen with a specified character, and so on.
  531.  
  532.    BlockMove FromSeg%, FromOfs%, ToSeg%, ToOfs%, Bytes&, Dirn%
  533.  
  534. FromSeg%    segment of the area from which to copy
  535. FromOfs%    offset of the area from which to copy
  536. ToSeg%      segment of the area to which to copy
  537. ToOfs%      offset of the area to which to copy
  538. Bytes&      number of bytes to copy (0-65,520)
  539. Dirn%       direction to copy (0 if forward, else backward)
  540.  
  541. Name  : BootDrive            (get Boot Drive)
  542. Class : Disk
  543. Level : DOS 4.0+
  544.  
  545. This routine tells you which drive was used to boot the
  546. system.  See also BootDrive2, a function version of this
  547. routine.
  548.  
  549. One use for BootDrive would be in installation programs, to
  550. determine the most likely destination drive for your software.
  551.  
  552.    Drive$ = "x"
  553.    BootDrive Drive$
  554.  
  555. -------
  556. Drive$   boot drive-- set it to at least one char beforehand!
  557.  
  558. Name  : BootDrive2$          (get Boot Drive)
  559. Class : Disk
  560. Level : DOS 4.0+
  561.  
  562. This routine tells you which drive was used to boot the system.
  563.  
  564. One use for BootDrive2 would be in installation programs, to
  565. determine the most likely destination drive for your software.
  566.  
  567.    Drive$ = BootDrive2$
  568.  
  569. -------
  570. Drive$   boot drive (null if wrong DOS version)
  571.  
  572. Name  : BoxMenu              (Box Menu)
  573. Class : Input
  574. Level : Clone
  575.  
  576. This routine displays a list of items you pass it as a string
  577. array.  The list is displayed in a window in a single column.
  578. If there are more items than will fit in the window, the items
  579. may be scrolled as necessary.  The user may pick a single item
  580. from the list.
  581.  
  582. Many of the usual WindowManager parameters are used here-- top
  583. row, left column, and bottom row (right column is calculated
  584. for you), window frame color and frame type, growth, shadow,
  585. title string and title color-- see the WindowManager routine
  586. for details.
  587.  
  588. If you allow using the mouse, be sure the mouse is initialized
  589. (MMCheck or MMCheck2%) and the mouse cursor is visible
  590. (MMCursorOn) before calling this routine.
  591.  
  592. This routine automatically saves and restores the underlying
  593. screen.
  594.  
  595. See CalcAttr if you're not familiar with color/attributes.  See
  596. also BoxMenu1 if you need to allow multiple selections.
  597.  
  598.    BoxMenu Mouse%, PickList$(), TopRow%, LeftCol%, _
  599.       BottomRow%, Frame%, FrameAttr%, ItemListAttr%, _
  600.       HiliteAttr%, TitleFore%, Title$, Grow%, Shade%, Result%
  601.  
  602. Mouse%          whether to support the mouse (0 no, -1 yes)
  603. PickList$()     items to pick from (starting at PickList$(1))
  604. TopRow%         top row of pick window
  605. LeftCol%        left column of pick window
  606. BottomRow%      bottom row of pick window
  607. Frame%          frame type
  608. FrameAttr%      frame color/attribute
  609. ItemListAttr%   item list color/attribute
  610. HiliteAttr%     highlight bar color/attribute
  611. TitleFore%      title foreground color (backgnd is frame color)
  612. Title$          title (use "" for no title)
  613. Grow%           window growth
  614. Shade%          window shadow
  615. -------
  616. Result%         number of item picked (0 if none)
  617.  
  618. Name  : BoxMenu1             (Box Menu variant 1)
  619. Class : Input
  620. Level : Clone
  621.  
  622. This routine displays a list of items you pass it as a string
  623. array.  The list is displayed in a window in a single column.
  624. If there are more items than will fit in the window, the items
  625. may be scrolled as necessary.  The user may pick multiple items
  626. from the list, using the space bar to toggle selection.
  627.  
  628. Many of the usual WindowManager parameters are used here-- top
  629. row, left column, and bottom row (right column is calculated
  630. for you), window frame color and frame type, growth, shadow,
  631. title string and title color-- see the WindowManager routine
  632. for details.
  633.  
  634. If you allow using the mouse, be sure the mouse is initialized
  635. (MMCheck or MMCheck2%) and the mouse cursor is visible
  636. (MMCursorOn) before calling this routine.
  637.  
  638. This routine automatically saves and restores the underlying
  639. screen.
  640.  
  641. See CalcAttr if you're not familiar with color/attributes.  See
  642. also BoxMenu if you only need single-item selection.
  643.  
  644. You must pass an integer array corresponding to the pick list
  645. array.  Each of the integers flags whether the corresponding
  646. item is picked-- 0 if no, -1 if yes.  You may initialize this
  647. array according to the selection defaults you prefer.
  648.  
  649. The Marker$ value is two characters which specify the left and
  650. right characters to use to mark an item as selected.  If you
  651. leave Marker$ = "", the default will be "<>".
  652.  
  653.    BoxMenu1 Mouse%, PickList$(), Picked%(), Marker$, TopRow%, _
  654.       LeftCol%, BottomRow%, Frame%, FrameAttr%, _
  655.       ItemListAttr%, HiliteAttr%, TitleFore%, Title$, Grow%, _
  656.       Shade%, Picks%
  657.  
  658. Mouse%          whether to support the mouse (0 no, -1 yes)
  659. PickList$()     items to pick from (starting at PickList$(1))
  660. Picked%()       if corresponding PickList$() item is picked
  661. Marker$         left and right pick markers ("" for default)
  662. TopRow%         top row of pick window
  663. LeftCol%        left column of pick window
  664. BottomRow%      bottom row of pick window
  665. Frame%          frame type
  666. FrameAttr%      frame color/attribute
  667. ItemListAttr%   item list color/attribute
  668. HiliteAttr%     highlight bar color/attribute
  669. TitleFore%      title foreground color (backgnd is frame color)
  670. Title$          title (use "" for no title)
  671. Grow%           window growth
  672. Shade%          window shadow
  673. -------
  674. Picked%()       if corresponding PickList$() item is picked
  675. Picks%          number of items picked (0 if none)
  676.  
  677. Name  : BRead                (Byte Read)
  678. Class : Disk
  679. Level : DOS
  680.  
  681. This routine reads a byte from a file into an integer.  The
  682. byte is zero-extended into the integer, providing a value that
  683. may range from 0-255.
  684.  
  685. The file must have been opened using FCreate or FOpen1.
  686.  
  687.    BRead Handle%, Value%, ErrCode%
  688.  
  689. Handle%    file handle
  690. -------
  691. Value%     byte read from file
  692. ErrCode%   DOS error code (0 if no error)
  693.  
  694. Name  : BreakCheck%          (Break key Check)
  695. Class : Input
  696. Level : BIOS
  697.  
  698. This routine is for use after BreakOff.  It allows you to see
  699. whether the Break key has been pressed since you last checked.
  700. The Break status is cleared after the value is returned.
  701.  
  702.    Brk% = BreakCheck%
  703.    IF Brk% THEN
  704.       PRINT "** Break key pressed **"
  705.       GOTO EndProgram
  706.    END IF
  707.  
  708. -------
  709. Brk%    whether Break was pressed (0 no, -1 yes)
  710.  
  711. Name  : BreakOff             (Break key Off)
  712. Class : Input
  713. Level : BIOS
  714.  
  715. This routine disables the Break key.  It is not effective in
  716. the QB or QBX environments, as these use their own keyboard
  717. handler.  It is also not effective if your program was compiled
  718. with Debugging on (/D switch).
  719.  
  720. Note that BreakOff installs a routine to intercept some
  721. interrupt vectors. You MUST use the BreakOffDone routine to
  722. reverse this process before your program ends, or the computer
  723. will be left in an indeterminate state and will probably crash
  724. the next time Break is pressed!
  725.  
  726.    BreakOff
  727.  
  728. Name  : BreakOffDone         (Break key Off routine Done)
  729. Class : Input
  730. Level : BIOS
  731.  
  732. This routine is used after BreakOff to restore the original
  733. interrupt vectors.  If you use BreakOff, you MUST call
  734. BreakOffDone before your program ends!  Otherwise, the computer
  735. will probably crash the next time someone presses Break.
  736.  
  737.    BreakOffDone
  738.  
  739. Name  : BSq                  (Blank Squeeze)
  740. Class : String
  741. Level : Any
  742.  
  743. A simple compression routine, BSq "squeezes" the blank spaces
  744. in a string. It is designed expressly for use with text data.
  745. The text may not contain more than 131 spaces in a row, or
  746. CHR$(128) through CHR$(255), which are used in the compression.
  747.  
  748. Average text files are liable to be compressed by around 16%.
  749. Files that contain more spaces, such as structured programs,
  750. will benefit more.  The compression algorithm is simple but
  751. extremely fast, adding no noticeable overhead to string
  752. processing.
  753.  
  754. See also BUsq, BUsqLen.
  755.  
  756.    BSq St$, StLen%
  757.    St$ = LEFT$(St$, StLen%)
  758.  
  759. St$     string to compress
  760. -------
  761. St$     compressed string
  762. StLen%  length of the compressed string
  763.  
  764. Name  : BUsq                 (Blank Unsqueeze)
  765. Class : String
  766. Level : Any
  767.  
  768. This routine is used to uncompress strings that were processed
  769. by BSq. Before uncompression, the BUsqLen routine must be used
  770. to find out how long the resulting string will be.
  771.  
  772. See also BSq, BUsqLen.
  773.  
  774.    BUsqLen St$, StLen%
  775.    IF StLen% < 0 THEN
  776.       PRINT "Error in compressed string"
  777.    ELSE
  778.       Result$ = SPACE$(StLen%)
  779.       BUsq St$, Result$
  780.    END IF
  781.  
  782. St$      string to uncompress
  783. -------
  784. Result$  uncompressed string
  785.  
  786. Name  : BUsqLen              (Blank Unsqueeze Length)
  787. Class : String
  788. Level : Any
  789.  
  790. This routine is used in coordination with BUsq to uncompress
  791. strings that were processed by BSq.  It determines what the
  792. length of the uncompressed string will be, which is necessary
  793. to initialize the string for BUsq.
  794.  
  795. See also BSq, BUsq.
  796.  
  797.    BUsqLen St$, StLen%
  798.    IF StLen% < 0 THEN
  799.       PRINT "Error in compressed string"
  800.    ELSE
  801.       Result$ = SPACE$(StLen%)
  802.       BUsq St$, Result$
  803.    END IF
  804.  
  805. St$      string to uncompress
  806. -------
  807. StLen%   length of the uncompressed string
  808.  
  809. Name  : BWrite               (Byte Write)
  810. Class : Disk
  811. Level : DOS
  812.  
  813. This routine writes a byte to a file from an integer.  The
  814. least significant byte of the integer is written.
  815.  
  816. The file must have been opened using FCreate or FOpen1.
  817.  
  818.    BWrite Handle%, Value%, ErrCode%
  819.  
  820. Handle%    file handle
  821. Value%     byte to write to file
  822. -------
  823. ErrCode%   DOS error code (0 if no error)
  824.  
  825. Name  : CalcAttr             (Calculate Attribute)
  826. Class : Display
  827. Level : Any
  828.  
  829. Many of the display routines in this library require an
  830. "attribute" rather than foreground and background colors.  An
  831. attribute is a combination of the foreground and background
  832. colors in a format which is used by all types of displays when
  833. in text mode.
  834.  
  835. Foreground colors are usually specified as 0-31, with
  836. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  837. may be more convenient to express the same thing as foreground
  838. 0-15, background 0-15.  The CalcAttr routine will accept either
  839. way of expressing it.
  840.  
  841. Note, however, that UnCalcAttr will always return the former
  842. pair of results, since it has no way of knowing whether Blink
  843. has been used (foreground 0-31, background 0-15).  See
  844. UnCalcAttr for more details and a solution.
  845.  
  846. See also CalcAttr2, the FUNCTION version of this routine.
  847.  
  848.    CalcAttr Foreground%, Background%, VAttr%
  849.  
  850. Foreground%  foreground color
  851. Background%  background color
  852. -------
  853. VAttr%       color "attribute"
  854.  
  855. Name  : CalcAttr2%           (Calculate Attribute)
  856. Class : Display
  857. Level : Any
  858.  
  859. Many of the display routines in this library require an
  860. "attribute" rather than foreground and background colors.  An
  861. attribute is a combination of the foreground and background
  862. colors in a format which is used by all types of displays when
  863. in text mode.
  864.  
  865. Foreground colors are usually specified as 0-31, with
  866. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  867. may be more convenient to express the same thing as foreground
  868. 0-15, background 0-15.  The CalcAttr2 routine will accept
  869. either way of expressing it.
  870.  
  871. Note, however, that UnCalcAttr will always return the former
  872. pair of results, since it has no way of knowing whether Blink
  873. has been used (foreground 0-31, background 0-15).  See
  874. UnCalcAttr for more details and a solution.
  875.  
  876. See also CalcAttr, the SUB version of this routine.
  877.  
  878.    VAttr% = CalcAttr2%(Foreground%, Background%)
  879.  
  880. Foreground%  foreground color
  881. Background%  background color
  882. -------
  883. VAttr%       color "attribute"
  884.  
  885. Name  : CalcDate             (Calculate Date)
  886. Class : Time
  887. Level : Any
  888.  
  889. This routine calculates what the date will be a given number of
  890. days from now, either in the past or the future.  Actually, you
  891. may use any starting date, not just the current date.  An error
  892. code is returned if the starting date or resulting date are not
  893. valid.  Dates may not preceed January 1, 1900.
  894.  
  895. CalcDate accepts the date in any standard form ("01/30/91" or
  896. "01-30-1991", for example) and returns its results in the same
  897. format.
  898.  
  899.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  900.  
  901. StartDate$   starting date
  902. Days&        number of days from the current date (0 or more)
  903. Direction%   return future result (0) or past (nonzero)
  904. -------
  905. NewDate$     resulting date
  906. ErrCode%     whether the dates are valid (0 yes)
  907.  
  908. Name  : CalcSize             (Calculate array Size)
  909. Class : Display
  910. Level : Any
  911.  
  912. This routine calculates the necessary DIM size for an integer
  913. array, assuming that you intend to store display data in the
  914. array.  This is most useful in conjunction with DGetScreen and
  915. GetScreen.
  916.  
  917.    CalcSize TopRow%, LeftCol%, BottomRow%, RightCol%, Elements%
  918.    DIM Array%(1 TO Elements%)
  919.  
  920. TopRow%      top row of the display area
  921. LeftCol%     left column of the display area
  922. BottomRow%   top row of the display area
  923. RightCol%    left column of the display area
  924. -------
  925. Elements%    required size of the integer array
  926.  
  927. Name  : CalcVGAColor         (Calculate VGA palette Color)
  928. Class : Display
  929. Level : Any
  930.  
  931. The QuickBASIC manual gives a cumbersome formula for
  932. calculating VGA palette colors.  This routine does it faster
  933. and with less fuss.  All you need to do is pass it the
  934. appropriate intensity values (0-63) and you get back a long
  935. integer, just the way BASIC wants it.
  936.  
  937.    CalcVGAColor Red%, Green%, Blue%, Colour&
  938.  
  939. Red%      red   intensity
  940. Green%    green intensity
  941. Blue%     blue  intensity
  942. -------
  943. Colour&   color value for use in the PALETTE statement
  944.  
  945. Name  : Carrier              (detect Carrier)
  946. Class : Serial
  947. Level : Clone
  948.  
  949. If you write communications programs, particularly things like
  950. doors and BBSes, you probably want to keep an eye on the
  951. carrier.  BASIC won't do it, but we will!
  952.  
  953.    Carrier CommPort%, CarrierHigh%
  954.  
  955. CommPort%     serial port (1-4, though BASIC only handles 1-2)
  956. -------
  957. CarrierHigh%  zero if no carrier
  958.  
  959. Name  : CatchError           (Catch Error from SHELL)
  960. Class : Miscellaneous
  961. Level : Clone
  962.  
  963. NOTE: You should use the GetError2% function in preference to
  964. this set of routines.
  965.  
  966. The CatchError routine is used in conjunction with GetError.
  967. It lets you get the exit code (error level) returned by a
  968. program to which you have SHELLed. Since CatchError hooks an
  969. interrupt to do its work, you must always make sure to use
  970. GetError afterwards to "clean up".  See also GetError.
  971.  
  972. Note that differences in DOS mean that this routine will not
  973. always work.  In some versions of DOS, you can only get the
  974. error level if a batch file was executed; in others, you can't
  975. get the error level from a batch file at all. Sorry about
  976. that.  I don't know of any way to work around it.
  977.  
  978.    CatchError
  979.    SHELL ProgramName$
  980.    GetError ExitCode%
  981.  
  982. Name  : CDROM                (check for CD-ROM)
  983. Class : Disk / Equipment
  984. Level : DOS
  985.  
  986. This routine tells you whether the Microsoft CD-ROM Extensions
  987. are installed. If so, it tells you what the letter of the first
  988. CD-ROM logical drive is and how many logical drives exist.
  989.  
  990. Note: The CD-ROM installation check conflicts with the
  991. GRAPHICS.COM installation check for DOS 4.0, due to some
  992. screw-up at IBM or Microsoft. This may cause unexpected
  993. results.  I'm not yet sure whether DOS 5.0 is similarly
  994. afflicted.
  995.  
  996.    FirstDrive$ = "x"
  997.    CDROM FirstDrive$, Drives%
  998.  
  999. -------
  1000. FirstDrive$   letter of first logical drive (init to >= 1 char)
  1001. Drives%       number of logical drives (0 if no CD-ROM)
  1002.  
  1003. Name  : CDROM2%              (check for CD-ROM)
  1004. Class : Disk / Equipment
  1005. Level : DOS
  1006.  
  1007. This routine tells you whether the Microsoft CD-ROM Extensions
  1008. are installed. If so, it tells you how many logical drives
  1009. exist.
  1010.  
  1011. Note: The CD-ROM installation check conflicts with the
  1012. GRAPHICS.COM installation check for DOS 4.0, due to some
  1013. screw-up at IBM or Microsoft. This may cause unexpected
  1014. results.  I'm not yet sure whether DOS 5.0 is similarly
  1015. afflicted.
  1016.  
  1017.    Drives% = CDROM2%
  1018.  
  1019. -------
  1020. Drives%       number of logical drives (0 if no CD-ROM)
  1021.  
  1022. Name  : CeilD#               (Ceiling, Double-precision)
  1023. Class : String
  1024. Level : Any
  1025.  
  1026. This function returns the smallest integer greater than or
  1027. equal to the number you give it.  This is most often used for
  1028. rounding.
  1029.  
  1030.    Result# = CeilD#(Nr#)
  1031.  
  1032. Nr#          number to process
  1033. -------
  1034. Result#      result
  1035.  
  1036. Name  : CeilS!               (Ceiling, Single-precision)
  1037. Class : String
  1038. Level : Any
  1039.  
  1040. This function returns the smallest integer greater than or
  1041. equal to the number you give it.  This is most often used for
  1042. rounding.
  1043.  
  1044.    Result! = CeilS!(Nr!)
  1045.  
  1046. Nr!          number to process
  1047. -------
  1048. Result!      result
  1049.  
  1050. Name  : CenterSt$            (Center String)
  1051. Class : String
  1052. Level : Any
  1053.  
  1054. This function returns a string centered in a field of spaces.
  1055.  
  1056.    Result$ = CenterSt$(StToCenter$, Columns%)
  1057.  
  1058. StToCenter$   string to center
  1059. Columns%      width of field in which to center string
  1060. -------
  1061. Result$       field of spaces with string centered in it
  1062.  
  1063. Name  : CheckDate            (Check Date validity)
  1064. Class : Time
  1065. Level : Any
  1066.  
  1067. This routine checks a date to see if it is valid.
  1068.  
  1069.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  1070.  
  1071. MonthNr%     month number (1-12)
  1072. DayNr%       day number (1-31)
  1073. YearNr%      year number (1900 on; years <100 assumed 1900s)
  1074. -------
  1075. ErrCode%     whether the date is valid (0 yes)
  1076.  
  1077. Name  : CheckDisk            (Check Disk readiness)
  1078. Class : Disk
  1079. Level : DOS
  1080.  
  1081. The CheckDisk routine determines whether a disk is ready.
  1082. About the only thing it won't tell you is if a disk is
  1083. write-protected or out of space. Since the PBClone disk
  1084. routines all contain critical error handling, which reports
  1085. back an appropriate error code for all such problems, this
  1086. routine isn't really needed any more.  It's included for
  1087. compatibility with older ProBas programs.
  1088.  
  1089. Results will normally be returned as one of the following,
  1090. although not all DOS versions report the exact cause of the
  1091. error, in which case the error number may not mean what you
  1092. expect.
  1093.  
  1094.    0   no error
  1095.    1   unformatted disk
  1096.    2   open drive door
  1097.    3   bad drive spec
  1098.  
  1099.    CheckDisk Drive$, ErrCode%
  1100.  
  1101. Drive$    letter of the drive to check
  1102. -------
  1103. ErrCode%  0 if no error, nonzero for error (see above)
  1104.  
  1105. Name  : CheckDsk%            (Check Disk readiness)
  1106. Class : Disk
  1107. Level : DOS
  1108.  
  1109. The CheckDsk% function determines whether a disk is ready.
  1110. About the only thing it won't tell you is if a disk is
  1111. write-protected or out of space. Since the PBClone disk
  1112. routines all contain critical error handling, which reports
  1113. back an appropriate error code for all such problems, this
  1114. routine isn't really needed any more.  It's included for
  1115. compatibility with older ProBas programs.
  1116.  
  1117. Note that DOS versions before 3.0 do not return as useful error
  1118. codes as later versions.  Under such circumstances, both
  1119. "unformatted disk" and "open drive door" will be returned as
  1120. "open drive door".
  1121.  
  1122.    ErrCode% = CheckDsk%(Drive$)
  1123.  
  1124. Drive$    letter of the drive to check
  1125.  
  1126. Name  : CheckKey             (Check for Key or mouse)
  1127. Class : Input, Mouse
  1128. Level : BIOS
  1129.  
  1130. This routine is kind of an extended version of INKEY$.  It
  1131. checks the keyboard to see if any key is available and gets the
  1132. key if it is.  At your option, it can also check the mouse to
  1133. see if a button has been pressed.
  1134.  
  1135.    CheckKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  1136.  
  1137. Mouse%        whether to check the mouse (0: no)
  1138. -------
  1139. ASCIIcode%    ASCII code of the key pressed
  1140. ScanCode%     scan code of the key pressed (0 if none)
  1141. LButton%      whether the left  mouse button was pressed
  1142. RButton%      whether the right mouse button was pressed
  1143.  
  1144. Name  : CheckKey3            (Check for Key or 3-button mouse)
  1145. Class : Input, Mouse
  1146. Level : BIOS
  1147.  
  1148. This routine is kind of an extended version of INKEY$.  It
  1149. checks the keyboard to see if any key is available and gets the
  1150. key if it is.  At your option, it can also check the mouse to
  1151. see if a button has been pressed.
  1152.  
  1153.    CheckKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  1154.       MButton%, RButton%
  1155.  
  1156. Mouse%        whether to check the mouse (0: no)
  1157. -------
  1158. ASCIIcode%    ASCII code of the key pressed
  1159. ScanCode%     scan code of the key pressed (0 if none)
  1160. LButton%      whether the left   mouse button was pressed
  1161. MButton%      whether the middle mouse button was pressed
  1162. RButton%      whether the right  mouse button was pressed
  1163.  
  1164. Name  : CheckShare           (Check for SHARE)
  1165. Class : Disk
  1166. Level : DOS
  1167.  
  1168. The CheckShare routine determines whether SHARE.EXE is active.
  1169. This is particularly helpful before using the BASIC OPEN
  1170. statement, which will fail if you request file sharing when
  1171. it's not available.  The PBClone file routines handle such
  1172. situations automatically, so CheckShare is not needed for them.
  1173.  
  1174.    CheckShare ShareActive%
  1175.  
  1176. -------
  1177. ShareActive%   whether SHARE is active (0 if no)
  1178.  
  1179. Name  : CheckShare2%         (Check for SHARE)
  1180. Class : Disk
  1181. Level : DOS
  1182.  
  1183. The CheckShare2% function determines whether SHARE.EXE is
  1184. active.  This is particularly helpful before using the BASIC
  1185. OPEN statement, which will fail if you request file sharing
  1186. when it's not available.  The PBClone file routines handle such
  1187. situations automatically, so CheckShare2% is not needed for
  1188. them.
  1189.  
  1190.    ShareActive% = CheckShare2%
  1191.  
  1192. -------
  1193. ShareActive%   whether SHARE is active (0 if no)
  1194.  
  1195. Name  : Checksum             (calculate Checksum)
  1196. Class : Serial
  1197. Level : Any
  1198.  
  1199. The Checksum routine calculates a checksum on a string.  The
  1200. resulting number is compatible with Xmodem and Ymodem checksum
  1201. routines and will vary from 0-255.  This checksum provides a
  1202. minimal, but fast, check of what characters are contained in
  1203. the string.  See also Checksum2%, the function version of this
  1204. routine, and CRC1.
  1205.  
  1206.    Checksum St$, ChkSum%
  1207.  
  1208. St$       string to process
  1209. -------
  1210. ChkSum%   checksum of the characters in the string
  1211.  
  1212. Name  : Checksum2%           (calculate Checksum)
  1213. Class : Serial
  1214. Level : Any
  1215.  
  1216. The Checksum2% function calculates a checksum on a string.  The
  1217. resulting number is compatible with Xmodem and Ymodem checksum
  1218. routines and will vary from 0-255.  This checksum provides a
  1219. minimal, but fast, check of what characters are contained in
  1220. the string.  See also Checksum, the sub version of this
  1221. function, and CRC1.
  1222.  
  1223.    ChkSum% = Checksum2% (St$)
  1224.  
  1225. St$       string to process
  1226. -------
  1227. ChkSum%   checksum of the characters in the string
  1228.  
  1229. Name  : Cipher               (Cipher)
  1230. Class : String
  1231. Level : Any
  1232.  
  1233. This is a very simple text encryption routine.  It isn't
  1234. particularly hard to crack, but will provide a basic level of
  1235. security for undemanding applications.  The same routine can be
  1236. used either to encrypt or decrypt text.  The original text may
  1237. contain any character; likewise, the resulting text.  This is
  1238. not well suited for use with sequential files-- if such is
  1239. required, see CipherP.
  1240.  
  1241. I'd suggest using a long password composed of an unlikely
  1242. string of characters, e.g. "#*@@!A^%x{.'".
  1243.  
  1244.    Cipher St$, Password$
  1245.  
  1246. St$        string to encrypt or decrypt
  1247. Password$  password
  1248. -------
  1249. St$        encrypted or decrypted string
  1250.  
  1251. Name  : CipherP              (Cipher Printable)
  1252. Class : String
  1253. Level : Any
  1254.  
  1255. This is a very simple text encryption routine.  It isn't
  1256. particularly hard to crack, but will provide a basic level of
  1257. security for undemanding applications.  The same routine can be
  1258. used either to encrypt or decrypt text.  The original text may
  1259. contain any character below CHR$(128), as may the password.
  1260. The resulting text will be printable, if bizarre (all
  1261. characters will be above CHR$(127)), and may be used with
  1262. sequential files.
  1263.  
  1264. This routine is potentially less secure than the Cipher routine
  1265. (see).
  1266.  
  1267. I'd suggest using a long password composed of an unlikely
  1268. string of characters, e.g. "#*@@!A^%x{.'".
  1269.  
  1270.    CipherP St$, Password$
  1271.  
  1272. St$        string to encrypt or decrypt
  1273. Password$  password
  1274. -------
  1275. St$        encrypted or decrypted string
  1276.  
  1277. Name  : ClearArea            (Clear a screen Area)
  1278. Class : Display
  1279. Level : Clone
  1280.  
  1281. This routine clears an area of the screen to a specified
  1282. color.  The clearing is done by removing random characters
  1283. until the area is totally clear.
  1284.  
  1285.    ClearArea TRow%, LCol%, BRow%, RCol%, VAttr%, Fast%
  1286.  
  1287. TRow%       top row of area to clear
  1288. LCol%       left column of area to clear
  1289. BRow%       bottom row of area to clear
  1290. RCol%       right column of area to clear
  1291. VAttr%      color/attribute to clear to
  1292. Fast%       whether to use fast displays (0 no)
  1293.  
  1294. Name  : Clock                (Clock)
  1295. Class : Display / Time
  1296. Level : Clone
  1297.  
  1298. This routine allows you to turn a visible time display on or
  1299. off.  When on, the time will be continuously displayed at a
  1300. selected location while your program continues processing.  The
  1301. clock is managed as a background process, in effect doing some
  1302. simple multitasking.
  1303.  
  1304. You should turn the clock off before you terminate your
  1305. program, including any time you execute another program with
  1306. RUN.  The clock can be safely kept on when you SHELL to another
  1307. program, however, as long as you can be sure that control will
  1308. return to your program when the other is done.
  1309.  
  1310. The clock must also be turned off if you change any of its
  1311. parameters with the ClockSet routine (see).
  1312.  
  1313. The clock will only be visible when the display is in text
  1314. mode.  The use of PLAY or SOUND statements may shut off the
  1315. clock, depending on your version of the BASIC compiler.
  1316.  
  1317.    Clock DisplayOn%
  1318.  
  1319. DisplayOn%   whether to display the clock (0 if no)
  1320.  
  1321. Name  : ClockSet             (Clock Settings)
  1322. Class : Display / Time
  1323. Level : Clone
  1324.  
  1325. The ClockSet routine is used in conjunction with Clock (see).
  1326. It should only be used when the clock is turned off.
  1327.  
  1328. This routine allows you to set 12-hour or 24-hour time, whether
  1329. to display the seconds or not, how often to update the clock
  1330. display (in 1/18th seconds; 9 is usually the best choice),
  1331. where to display the clock and in what color, and whether to
  1332. use flicker-free displays (needed for cheap CGAs only).  The
  1333. defaults are 12-hour time, display seconds, put the time (in
  1334. white on black) in the upper right corner, and display quickly
  1335. (may flicker on some CGAs).
  1336.  
  1337.    ClockSet Hours24%, Seconds%, Updates%, Row%, Column%, _
  1338.       VAttr%, Fast%
  1339.  
  1340. Hours24%   whether to display 24-hour time (0 if no)
  1341. Seconds%   whether to display seconds (0 if no)
  1342. Updates%   display update frequency in 1/18th seconds
  1343. Row%       row on which to display the clock
  1344. Col%       column at which to display the clock
  1345. VAttr%     color/attribute to use (see CalcAttr)
  1346. Fast%      whether to use fast mode (0 no)
  1347.  
  1348. Name  : CloseA               (Close Archive)
  1349. Class : Disk / Time
  1350. Level : DOS
  1351.  
  1352. This routine closes an archive opened by FindFirstA or
  1353. FindNextA.  It must be used when you are done searching the
  1354. archive.
  1355.  
  1356. Routines in this series include:
  1357.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  1358.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  1359.  
  1360.    CloseA
  1361.  
  1362. Name  : ClrCols              (Clear Columns)
  1363. Class : Display
  1364. Level : BIOS
  1365.  
  1366. This routine clears the current row between the specified
  1367. columns, inclusive. It does not affect the cursor position.
  1368.  
  1369.    ClrCols StartCol%, EndCol%
  1370.  
  1371. StartCol%  starting column
  1372. EndCol%    ending column
  1373.  
  1374. Name  : ClrEOL               (Clear to End Of Line)
  1375. Class : Display
  1376. Level : BIOS
  1377.  
  1378. This routine clears from the cursor to the end of the line,
  1379. inclusive.  It does not affect the current cursor position.
  1380.  
  1381.    ClrEOL
  1382.  
  1383. Name  : ClrEOP               (Clear to End Of Page)
  1384. Class : Display
  1385. Level : BIOS
  1386.  
  1387. This routine clears from the cursor to the end of the display,
  1388. inclusive.  It does not affect the current cursor position.
  1389.  
  1390.    ClrEOP
  1391.  
  1392. Name  : ClrKbd               (Clear Keyboard buffer)
  1393. Class : Input
  1394. Level : DOS
  1395.  
  1396. ClrKbd clears the keyboard buffer, discarding any keys that may
  1397. be waiting. This is a good idea for situations where an
  1398. unexpected input is made and you don't want to chance it being
  1399. answered accidentally by keys that were typed beforehand-- for
  1400. instance, in the event of an error or other condition where it
  1401. is important that the user see a message or take an action
  1402. before pressing a key.
  1403.  
  1404.    ClrKbd
  1405.  
  1406. Name  : ClrSOL               (Clear to Start Of Line)
  1407. Class : Display
  1408. Level : BIOS
  1409.  
  1410. This routine clears from the start of the line to the cursor,
  1411. inclusive.  It does not affect the current cursor position.
  1412.  
  1413.    ClrSOL
  1414.  
  1415. Name  : ClrSOP               (Clear to Start Of Page)
  1416. Class : Display
  1417. Level : BIOS
  1418.  
  1419. This routine clears from the start of the display to the
  1420. cursor, inclusive. It does not affect the current cursor
  1421. position.
  1422.  
  1423.    ClrSOP
  1424.  
  1425. Name  : Command2$            (Command line)
  1426. Class : Miscellaneous
  1427. Level : DOS
  1428.  
  1429. This function returns the original DOS command line.  It works
  1430. like COMMAND$, but does not trim or capitalize the command
  1431. line.
  1432.  
  1433. The area in which the command line is stored may be recycled
  1434. for other purposes, so you should use Command2$ as near to the
  1435. start of your program as possible.
  1436.  
  1437.    CmdLine$ = Command2$
  1438.  
  1439. -------
  1440. CmdLine$    original DOS command line
  1441.  
  1442. Name  : CopyFile             (Copy a File)
  1443. Class : Disk
  1444. Level : DOS
  1445.  
  1446. This works like the DOS COPY command, although it does not
  1447. allow wildcards. One file is copied to another, retaining the
  1448. same date and time.  Full path specifications are supported,
  1449. including drive and subdirectory specs.
  1450.  
  1451. See also FileCopy, which supports wildcards.
  1452.  
  1453.    CopyFile FromFile$, ToFile$, ErrCode%
  1454.  
  1455. FromFile$   name of file to copy
  1456. ToFile$     name of new file to create
  1457. -------
  1458. ErrCode%    0 if no error, else DOS Error
  1459.  
  1460. Name  : CPrintScreen1        (CGA Print Screen [SCREEN 1])
  1461. Class : Display / Printer
  1462. Level : Clone
  1463.  
  1464. This routine dumps a SCREEN 1 display (CGA 320x200) to the
  1465. printer.  It uses the stdprn device (normally PRN or LPT1) by
  1466. default, although this can be altered with the PrtSwap routine.
  1467.  
  1468.    CPrintScreen1
  1469.  
  1470. Name  : CPrintScreen2        (CGA Print Screen [SCREEN 2])
  1471. Class : Display / Printer
  1472. Level : Clone
  1473.  
  1474. This routine dumps a SCREEN 2 display (CGA 640x200) to the
  1475. printer.  It uses the stdprn device (normally PRN or LPT1) by
  1476. default, although this can be altered with the PrtSwap routine.
  1477.  
  1478.    CPrintScreen2
  1479.  
  1480. Name  : CPUSpeed%            (CPU Speed)
  1481. Class : Equipment
  1482. Level : Clone
  1483.  
  1484. This function returns the approximate CPU speed in MHz.  It may
  1485. take several seconds to find the speed of slower processors, so
  1486. don't expect an immediate response.  Results can be skewed by
  1487. multitasking and background processing.
  1488.  
  1489.    MHz% = CPUSpeed%
  1490.  
  1491. -------
  1492. MHz%       approximate CPU speed
  1493.  
  1494. Name  : CRC                  (calculate CRC)
  1495. Class : String / Serial
  1496. Level : Any
  1497.  
  1498. This routine has become obsolete; the CRC1 routine is much
  1499. faster.  However, CRC is still included for backwards
  1500. compatibility.
  1501.  
  1502. This routine calculates a complex 16-bit checksum, called a
  1503. Cyclical Redundancy Check (or CRC) on a string.  The results
  1504. are compatible with Xmodem and Ymodem CRC routines.  The CRC
  1505. provides a fairly reliable check of what characters are
  1506. contained in the string.  See also Checksum.
  1507.  
  1508. If you are using this routine for Xmodem or Ymodem, note that
  1509. the string should be padded with two null characters before
  1510. calculating a "send" CRC: St$ = St$ + STRING$(2, 0).  On
  1511. receive, you should calculate the CRC on the entire data block,
  1512. plus the received CRC; if the block was received correctly, the
  1513. calculated CRC will be zero in both lsb and msb.
  1514.  
  1515. Although Intel notation uses "lsb, msb" order, the
  1516. Xmodem/Ymodem CRC uses the opposite format, which is why the
  1517. parameters are ordered in this fashion.
  1518.  
  1519.    CRC St$, CRCmsb%, CRClsb%
  1520.  
  1521. St$       string to process
  1522. -------
  1523. CRCmsb%   most significant byte of CRC
  1524. CRClsb%   least significant byte of CRC
  1525.  
  1526. Name  : CRC1                 (calculate CRC)
  1527. Class : String / Serial
  1528. Level : Any
  1529.  
  1530. This routine calculates a complex 16-bit checksum, called a
  1531. Cyclical Redundancy Check (or CRC) on a string.  The results
  1532. are compatible with Xmodem and Ymodem CRC routines.  The CRC
  1533. provides a fairly reliable check of what characters are
  1534. contained in the string.  See also Checksum.
  1535.  
  1536. Note that CRC1 does not work like the older CRC routine.  You
  1537. should not pad outgoing strings with a STRING$(2, 0) sequence.
  1538.  
  1539. Although Intel notation uses "lsb, msb" order, the
  1540. Xmodem/Ymodem CRC uses the opposite format, which is why the
  1541. parameters are ordered in this fashion.
  1542.  
  1543.    CRC1 St$, CRCmsb%, CRClsb%
  1544.  
  1545. St$       string to process
  1546. -------
  1547. CRCmsb%   most significant byte of CRC
  1548. CRClsb%   least significant byte of CRC
  1549.  
  1550. Name  : Crunch               (Crunch repeated characters)
  1551. Class : String
  1552. Level : Any
  1553.  
  1554. It was hard to decide on a name for this routine, and I don't
  1555. know if I've done the best job.  What Crunch does is to
  1556. eliminate repeated sequences of the same character.  For
  1557. instance, if you gave it "This    is a   test" and asked it to
  1558. crunch spaces, it would return "This is a test".  I use this to
  1559. filter information from the COMMAND$ function, but it's a good
  1560. general purpose input filter.
  1561.  
  1562.    Crunch St$, Ch$, StLen%
  1563.    St$ = LEFT$(St$, StLen%)
  1564.  
  1565. St$       string to be processed
  1566. Ch$       character to crunch out of the string
  1567. -------
  1568. St$       crunched string
  1569. StLen%    length of the crunched string
  1570.  
  1571. Name  : CtrlKey              (Control Key)
  1572. Class : Input
  1573. Level : Any
  1574.  
  1575. This routine works in conjunction with a key input routine,
  1576. such as INKEY$ or the CheckKey and GetKey routines.  Given the
  1577. ASCII code of a key, CtrlKey returns the associated key letter,
  1578. if any.  For instance, it returns "A" if you pass it ASCII code
  1579. 1, because that code represents Ctrl-A.
  1580.  
  1581.    CtrlKey ASCIICode%, Ky$
  1582.  
  1583. ASCIICode%   ASCII code of the key
  1584. -------
  1585. Ky$          associated key letter ("" if none)
  1586.  
  1587. Name  : CursorInfo           (Cursor Information)
  1588. Class : Input
  1589. Level : Clone
  1590.  
  1591. While BASIC allows you to set the size and shape of the cursor
  1592. with LOCATE, it's fairly hazardous to do so.  There is no way
  1593. to find out the maximum size of the cursor, so your cursor may
  1594. end up a peculiar shape on some adapters. If you change the
  1595. cursor size or visibility in a subprogram, you may be screwing
  1596. up the main program.
  1597.  
  1598. CursorInfo offers a solution to these problems.  It returns the
  1599. current cursor visibility and size, plus the maximum size
  1600. possible with the current video adapter.  The minimum size will
  1601. always be zero, so it is not reported.
  1602.  
  1603.    CursorInfo Visible%, StartLine%, EndLine%, MaxLine%
  1604.  
  1605. -------
  1606. Visible%      whether the cursor is visible (0 no, 1 yes)
  1607. StartLine%    starting scan line of cursor
  1608. EndLine%      ending scan line of cursor
  1609. MaxLine%      maximum possible scan line for cursor
  1610.  
  1611. Name  : CWindowManager       (CGA Window Manager)
  1612. Class : Display
  1613. Level : Clone
  1614.  
  1615. CWindowManager displays a pop-up window on a CGA graphics
  1616. screen.  It is intended for SCREEN 1, although it can be used
  1617. on SCREEN 2 as well (it will still have 40 columns and will
  1618. display shades rather than colors).  The window may have any of
  1619. a variety of frames, a title, or a shadow, and it may appear
  1620. instantly or "grow" onto the screen.
  1621.  
  1622. These are the available frame types:
  1623.     0   no frame
  1624.     1   single lines
  1625.     2   double lines
  1626.     3   single horizontal, double vertical lines
  1627.     4   double horizontal, single vertical lines
  1628.     5   block graphic lines
  1629.  
  1630. Options for growing windows are as follows:
  1631.    -1   grow as fast as possible
  1632.     0   pop onto the screen
  1633.    1+   grow with delay given in milliseconds (15 works for me)
  1634.  
  1635. Note that this routine is different from its ProBas equivalent
  1636. in a number of respects.  The grow delay time is different.
  1637. Growing is done more smoothly. The shadow and title parameters
  1638. are not changed by this routine.  A new frame type (5) was
  1639. added.  If a title is too long, it is truncated instead of
  1640. being ignored completely.  Using a -1 as the title foreground
  1641. color will not turn off the title; instead, use a null title
  1642. string.
  1643.  
  1644.    CWindowManager TRow%, LCol%, BRow%, RCol%, Frame%,
  1645.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Fast%
  1646.  
  1647. TRow%       top row of window
  1648. LCol%       left column of window
  1649. BRow%       bottom row of window
  1650. RCol%       right column of window
  1651. Frame%      frame type (see above)
  1652. Fore%       frame foreground color
  1653. Back%       frame background color
  1654. Grow%       window growing option (see above)
  1655. Shade%      window shadow option (0 for none)
  1656. TFore%      title foreground color
  1657. Title$      window title ("" if none)
  1658. Fast%       whether to use fast mode (0 no)
  1659.  
  1660. Name  : DataSeg              (Data Segment)
  1661. Class : Memory
  1662. Level : Any
  1663.  
  1664. It's rare that you need to know the data segment used by BASIC,
  1665. but it does happen.  DataSeg tells you that value.  This is the
  1666. segment used by (near) strings, static arrays (except in the
  1667. QuickBASIC environment), some COMMON data, BASIC internal
  1668. variables and so forth.  It is also the area specified by a
  1669. plain "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1670.  
  1671. There is also a function version of this routine, DataSeg2%.
  1672.  
  1673.    DataSeg DSeg%
  1674.  
  1675. -------
  1676. DSeg%     data segment for BASIC
  1677.  
  1678. Name  : DataSeg2%            (Data Segment)
  1679. Class : Memory
  1680. Level : Any
  1681.  
  1682. It's rare that you need to know the data segment used by BASIC,
  1683. but it does happen.  DataSeg2% tells you that value.  This is
  1684. the segment used by (near) strings, static arrays (except in
  1685. the QuickBASIC environment), some COMMON data, BASIC internal
  1686. variables and so forth.  It is also the area specified by a
  1687. plain "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1688.  
  1689. There is also a sub version of this routine, DataSeg.
  1690.  
  1691.    DSeg% = DataSeg2%
  1692.  
  1693. -------
  1694. DSeg%     data segment for BASIC
  1695.  
  1696. Name  : Date2Int             (Date to Integer)
  1697. Class : Time
  1698. Level : Any
  1699.  
  1700. This routine compresses a date into a single integer.  Note
  1701. that this integer is not in a format that lends itself to
  1702. simple computation-- you cannot subtract one from another to
  1703. find out the length of time between them. However, as long as
  1704. the year is in the range 1980-2042, you can compare the two
  1705. integers to see if one date is before or after another.
  1706.  
  1707. You may express the year as either a two-digit or four-digit
  1708. number.
  1709.  
  1710. The ProBas and PBClone versions of this routine do not work the
  1711. same way in regards to the year.  ProBas assumed that any
  1712. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1713. that years 80-99 should be converted to 1980-1999 and that 0-79
  1714. should be converted to 2000-2079.  I consider the PBClone
  1715. method more appropriate, with the turn of the century moving
  1716. closer. The date format used does not allow dates before 1980
  1717. anyway, so nothing is being lost by this change.
  1718.  
  1719.    Date2Int MonthNr%, DayNr%, YearNr%, IntDate%
  1720.  
  1721. MonthNr%     month number (1-12)
  1722. DayNr%       day (1-31)
  1723. YearNr%      year (1980-2079; see above for two-digit years)
  1724. -------
  1725. IntDate%     date compressed into an integer
  1726.  
  1727. Name  : DateA2R              (Date Actual to Relative)
  1728. Class : Time
  1729. Level : Any
  1730.  
  1731. This routine converts an actual date to a relative date,
  1732. expressed as a number of days.  This allows you to compare
  1733. dates, find out what the date will be in a given number of days
  1734. (or what it was a given number of days ago), see how many days
  1735. passed between two dates, and so forth.
  1736.  
  1737. I've frequently seen routines of this nature called "Julian
  1738. date" routines. I'm not sure where that nomenclature
  1739. originated, as it has nothing to do with the Julian calendar.
  1740. Most of these routines rely on approximations through floating
  1741. point math, and may or may not handle leap years and centuries
  1742. appropriately.  The DateA2R routine takes no such shortcuts and
  1743. may be relied upon to return accurate results.
  1744.  
  1745.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  1746.  
  1747. MonthNr%     month number (1-12)
  1748. DayNr%       day number (1-31)
  1749. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  1750. -------
  1751. RelDate&     relative date
  1752.  
  1753. Name  : DateN2S              (Date Numbers to String)
  1754. Class : Time
  1755. Level : Any / DOS
  1756.  
  1757. Many of the PBClone routines return the date as a set of
  1758. numbers.  This routine provides an easy way to convert those
  1759. numbers into string form.  The date format used (year length
  1760. and delimiter) will be based on the string which you pass to
  1761. the routine.  For instance, "xx-xx-xxxx" will return a date
  1762. like "11-26-1990", whereas "xx.xx.xxxx" would return
  1763. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  1764.  
  1765. If you pass zeroes for the MonthNr%, DayNr%, and YearNr%
  1766. values, the current date will be returned in the format that
  1767. you specified.
  1768.  
  1769. The ProBas and PBClone versions of this routine do not work the
  1770. same way in regards to the year.  ProBas assumed that any
  1771. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1772. that years 80-99 should be converted to 1980-1999 and that 0-79
  1773. should be converted to 2000-2079.
  1774.  
  1775.    DateSt$ = "xx-xx-xxxx"
  1776.    DateN2S MonthNr%, DayNr%, YearNr%, DateSt$
  1777.  
  1778. MonthNr%  month
  1779. DayNr%    day
  1780. YearNr%   year
  1781. -------
  1782. DateSt$   date string.  Init to 8 or 10 chars (see above).
  1783.  
  1784. Name  : DateR2A              (Date Relative to Actual)
  1785. Class : Time
  1786. Level : Any
  1787.  
  1788. This is the opposite of the DateA2R routine-- it takes a
  1789. "relative" date and converts it back to the usual form.
  1790.  
  1791.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  1792.  
  1793. RelDate&     relative date
  1794. -------
  1795. MonthNr%     month number (1-12)
  1796. DayNr%       day number (1-31)
  1797. YearNr%      year number (1900 on)
  1798.  
  1799. Name  : DateS2N              (Date String to Numbers)
  1800. Class : Time
  1801. Level : Any
  1802.  
  1803. Many of the PBClone routines need to be passed the date as a
  1804. set of numbers. This routine provides an easy way to convert a
  1805. date from string form into numbers.  You may use either
  1806. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  1807. length is important, but the delimiter and contents of the
  1808. string are ignored).
  1809.  
  1810. The ProBas and PBClone versions of this routine do not work the
  1811. same way in regards to the year.  ProBas assumed that any
  1812. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1813. that years 80-99 should be converted to 1980-1999 and that 0-79
  1814. should be converted to 2000-2079.
  1815.  
  1816.    DateS2N MonthNr%, DayNr%, YearNr%, DateSt$
  1817.  
  1818. DateSt$   date string.  Init to 8 or 10 characters (see above).
  1819. -------
  1820. MonthNr%  month
  1821. DayNr%    day
  1822. YearNr%   year
  1823.  
  1824. Name  : DCal                 (Direct-to-memory Calendar)
  1825. Class : Time
  1826. Level : Any
  1827.  
  1828. This routine draws a calendar for a specific month and year.
  1829. The results are placed in an array which can be displayed using
  1830. ScrRest or the other PBClone routines to restore a screen image.
  1831.  
  1832. You must supply an integer array large enough to hold the image
  1833. generated by DCal, which expects a 25x80 screen.  DIM Scrn%(1
  1834. TO 2000) will do it.  If you supply a null date, the current
  1835. date will be used.
  1836.  
  1837.    DCal Scrn%(), CalDate$
  1838.  
  1839. Scrn%()      array to hold screen image
  1840. CalDate$     date for the calendar
  1841. Page%        ignored
  1842. Fast%        ignored
  1843.  
  1844. Name  : DCalendar            (Direct-to-memory Calendar)
  1845. Class : Time
  1846. Level : Clone
  1847.  
  1848. This routine displays a calendar for a specific month and
  1849. year.  It waits for input and acts accordingly, allowing the
  1850. user to move to different dates via the arrow keys or by
  1851. entering the date directly. The bottom row of the screen gives
  1852. a list of the available key commands.
  1853.  
  1854. Screen handling is largely done by writing to an array, then
  1855. dumping the entire array to the display with DScrRest.  This
  1856. provides for very smooth displays.  You must supply an integer
  1857. array large enough to hold the image generated by DCalendar,
  1858. which expects a 25x80 screen.  DIM Scrn%(1 TO 2000) will do
  1859. it.  Only text mode is supported by this routine.
  1860.  
  1861. If you supply a null date, the current date will be used.
  1862.  
  1863.    DCalendar Scrn%(), CalDate$, Page%, Fast%
  1864.  
  1865. Scrn%()      array to hold screen image
  1866. CalDate$     date for the calendar
  1867. Page%        page on which to display (normally zero)
  1868. Fast%        whether to use fast mode (0 no)
  1869.  
  1870. Name  : DClear               (Direct-to-memory Clear)
  1871. Class : Display
  1872. Level : Any
  1873.  
  1874. The DClear routine allows you to clear a text-mode display.
  1875.  
  1876. This routine does not necessarily work on the display itself.
  1877. Instead, it allows you to specify the memory location (segment
  1878. and offset) of the "screen", which may be an actual screen, a
  1879. saved screen in an array, a multitasker's virtual screen, etc.
  1880. Among other things, this makes it easy to work with two
  1881. displays at once: use a segment of &HB000 for the mono display
  1882. and &HB800 for the color display (the offset in each case is
  1883. zero).
  1884.  
  1885.    DClear DSeg%, DOfs%, VAttr%
  1886.  
  1887. DSeg%    segment of "screen" memory
  1888. DOfs%    offset of "screen" memory
  1889. VAttr%   color/attribute to use (see CalcAttr)
  1890.  
  1891. Name  : DClearSS             (Direct Clear for Specified Size)
  1892. Class : Display
  1893. Level : Any
  1894.  
  1895. Like the CLS statement, this routine allows you to clear a text
  1896. display. However, rather than clearing the actual screen,
  1897. DClearSS clears a screen that is stored in an array.  This
  1898. allows you to design a screen in memory, then flash it onto the
  1899. display using PutScreen or a similar routine.
  1900.  
  1901. This routine is designed for a text screen of any specified
  1902. size.
  1903.  
  1904.    DClearSS DSeg%, DOfs%, VAttr%, Rows%, Columns%
  1905.  
  1906. DSeg%     segment of the array that holds the screen
  1907. DOfs%     offset of the array that holds the screen
  1908. VAttr%    color/attribute to use (see CalcAttr)
  1909. Rows%     length of the screen
  1910. Columns%  width of the screen
  1911.  
  1912. Name  : Dec2Any              (Decimal to Any base)
  1913. Class : Numeric
  1914. Level : Any
  1915.  
  1916. This routine converts a normal integer to a number in any
  1917. base.  It works like the HEX$ function in BASIC, but rather
  1918. than working only in hexadecimal (base 16), it can be used for
  1919. binary, octal, or almost anything else.
  1920.  
  1921. The result will be right-justified in the string you provide.
  1922. If you use zeroes, this allows you to ignore the NumberLen%
  1923. spec and just trim the string to the desired length, leaving
  1924. nothing worse than possible leading zeroes.
  1925.  
  1926. The length needed by the return string will vary according to
  1927. the number, with a maximum length depending on the number base
  1928. chosen.  For integers, this will be at most 16 characters
  1929. (worst case: base 2 or binary).
  1930.  
  1931.    Number$ = STRING$(16, "0")
  1932.    Dec2Any DecimalNr%, NrBase%, Number$, NumberLen%
  1933.    Number$ = RIGHT$(Number$, NumberLen%)
  1934.  
  1935. DecimalNr   integer to convert to another base
  1936. NrBase%     desired number base (2-31)
  1937. -------
  1938. Number$     resulting number in desired base (init >= 16 chars)
  1939. NumberLen%  length of the result (-1 if string too short)
  1940.  
  1941. Name  : Delay                (Delay for seconds)
  1942. Class : Time
  1943. Level : Clone
  1944.  
  1945. This routine delays for a given number of seconds.  The timing
  1946. will be the same from an 8088 PC through an 80486 AT-- it's
  1947. entirely independent of the processor.  See also Delay18th.
  1948.  
  1949.    Delay Seconds%
  1950.  
  1951. Seconds%   number of seconds for which to delay
  1952.  
  1953. Name  : Delay18th            (Delay for 1/18th seconds)
  1954. Class : Time
  1955. Level : Clone
  1956.  
  1957. This routine delays for a given number of 18ths of seconds.
  1958. The timing will be the same from an 8088 PC through an 80486
  1959. AT-- it's entirely independent of the processor.  See also
  1960. Delay.
  1961.  
  1962.    Delay WaitTime%
  1963.  
  1964. WaitTime%  number of 18ths of seconds for which to delay
  1965.  
  1966. Name  : DelayV               (Delay based on Video timing)
  1967. Class : Time
  1968. Level : Clone
  1969.  
  1970. This routine delays for a given number of milliseconds.  The
  1971. timing is based on a signal from the video adapter and may vary
  1972. somewhat depending on the adapter.  The delay is largely
  1973. independent of the cpu type and speed, however.
  1974.  
  1975. For anyone unfamiliar with the metric system: there are 1000
  1976. milliseconds in one second.  Depending on the specific display
  1977. adapter, this routine may well be fairly inaccurate; it is
  1978. intended for providing small delays for animation and similar
  1979. purposes, not as a reliable timer.
  1980.  
  1981.    DelayV MilliSeconds%
  1982.  
  1983. MilliSeconds%   number of milliseconds for which to delay
  1984.  
  1985. Name  : DelChr               (Delete Character)
  1986. Class : Display
  1987. Level : Clone
  1988.  
  1989. The DelChr routine deletes the character at the specified
  1990. screen location.
  1991.  
  1992.    DelChr Row%, Column%
  1993.  
  1994. Row%      row of character
  1995. Column%   column of character
  1996.  
  1997. Name  : DelFile              (Delete File)
  1998. Class : Disk
  1999. Level : DOS
  2000.  
  2001. This works like the DOS DEL (or ERASE) command, although it
  2002. does not allow wildcards.  The specified file is deleted.  Full
  2003. path specifications are supported, including drive and
  2004. subdirectory specs.
  2005.  
  2006.    DelFile FileName$, ErrCode%
  2007.  
  2008. FileName$   name of the file to delete
  2009. -------
  2010. ErrCode%    0 if no error, else DOS Error
  2011.  
  2012. Name  : DelLine              (Delete Line)
  2013. Class : Display
  2014. Level : BIOS
  2015.  
  2016. This routine deletes the specified row from the screen.
  2017.  
  2018.    DelLine Row%, VAttr%
  2019.  
  2020. Row%      row to delete
  2021. VAttr%    color/attr to use on new bottom row (see CalcAttr)
  2022.  
  2023. Name  : DelSub               (Delete Subdirectory)
  2024. Class : Disk
  2025. Level : DOS
  2026.  
  2027. This works like the DOS RD (or RMDIR) command.  It does not
  2028. allow wildcards. The specified subdirectory is deleted.  Note
  2029. that you may not delete a subdirectory that you're located in,
  2030. or a subdirectory which contains files, or the root directory.
  2031.  
  2032.    DelSub SubDir$, ErrCode%
  2033.  
  2034. SubDir$     name of the subdirectory to delete
  2035. -------
  2036. ErrCode%    0 if no error, else DOS Error
  2037.  
  2038. Name  : DFRead               (Direct-to-memory File Read)
  2039. Class : Disk
  2040. Level : DOS
  2041.  
  2042. This routine reads data into an array from a file that was
  2043. opened by FOpen1 or FCreate.  If it wasn't possible to read it
  2044. all from the file, an error code will be returned and the
  2045. BytesRead% value will tell you how many bytes were actually
  2046. read.
  2047.  
  2048.    DFRead Handle%, DSeg%, DOfs%, Bytes%, BytesRead%, ErrCode%
  2049.  
  2050. Handle%     handle of the file from which to read
  2051. DSeg%       segment of the array into which to read the file
  2052. DOfs%       offset of the array into which to read the file
  2053. Bytes%      number of bytes to read
  2054. -------
  2055. BytesWrit%  # of bytes actually read from the file (if error)
  2056. ErrCode%    error code: 0 if no error, else DOS Error
  2057.  
  2058. Name  : DFWrite              (Direct-from-memory File Write)
  2059. Class : Disk
  2060. Level : DOS
  2061.  
  2062. This routine writes data from an array to a file that was
  2063. opened by FOpen1 or FCreate.  If it wasn't possible to write it
  2064. all to the file, an error code will be returned and the
  2065. BytesWrit% value will tell you how many bytes were actually
  2066. written.
  2067.  
  2068.    DFWrite Handle%, DSeg%, DOfs%, Bytes%, BytesWrit%, ErrCode%
  2069.  
  2070. Handle%     handle of the file to which to write
  2071. DSeg%       segment of the data to write to the file
  2072. DOfs%       offset of the data to write to the file
  2073. Bytes%      number of bytes to write
  2074. -------
  2075. BytesWrit%  # of bytes actually written to the file (if error)
  2076. ErrCode%    error code: 0 if no error, else DOS Error
  2077.  
  2078. Name  : DGClear              (Direct-to-memory Graphics Clear)
  2079. Class : Display
  2080. Level : Any
  2081.  
  2082. This routine works like the CLS statement, clearing a CGA
  2083. graphics display. However, rather than clearing the actual
  2084. screen, DClearSS clears a screen that is stored in an array.
  2085. This allows you to design a screen in memory, then flash it
  2086. onto the display using GrafRest.
  2087.  
  2088. This routine is designed for use with SCREEN 1 or SCREEN 2 (CGA
  2089. graphics).
  2090.  
  2091.    DGClear DSeg%, DOfs%, Colour%
  2092.  
  2093. DSeg%     segment of the array that holds the screen
  2094. DOfs%     offset of the array that holds the screen
  2095. Colour%   color to use
  2096.  
  2097. Name  : DGetRec              (Direct-from-memory Get Record)
  2098. Class : String
  2099. Level : Clone
  2100.  
  2101. The DGetRec routine allows you to get a string from a specified
  2102. area of memory (numeric array, BIOS data area, display memory,
  2103. or whatever).  The string should be initialized to the desired
  2104. record length in advance.
  2105.  
  2106. This works somewhat like an array of fixed length strings or a
  2107. random file, treating memory as a contiguous series of records
  2108. of a specified length.
  2109.  
  2110.    DGetRec DSeg%, DOfs%, RecNr%, St$
  2111.  
  2112. DSeg%      segment of the array to read from
  2113. DOfs%      offset of the array to read from
  2114. RecNr%     record number (starting at 1)
  2115. -------
  2116. St$        returned string.  Init to record length (see above).
  2117.  
  2118. Name  : DGetScreen           (Direct memory Get Screen image)
  2119. Class : Display
  2120. Level : Clone
  2121.  
  2122. This routine saves any portion of the display to an array.
  2123. Only text modes are supported.  If your program uses multiple
  2124. display pages, you can get an image from any of those pages.  A
  2125. special "slow" mode is supported for the CGA, to prevent
  2126. flickering (a problem only with some CGAs).
  2127.  
  2128. The size of the integer array needed to store a specific area
  2129. of the screen can be calculated using the CalcSize routine
  2130. (see).
  2131.  
  2132. The GetScreen routine works the same way as this, but has a
  2133. simpler calling convention.  Also, if you wish to save the
  2134. entire screen, you may find ScrSave easier.
  2135.  
  2136.    DGetScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2137.       Page%, Fast%
  2138.  
  2139. DSeg%      segment of the array in which to store the image
  2140. DOfs%      offset of the array in which to store the image
  2141. TRow%      top row of the desired screen area
  2142. LCol%      left column of the desired screen area
  2143. BRow%      bottom row of the desired screen area
  2144. RCol%      right column of the desired screen area
  2145. Page%      page from which to get the display area
  2146. Fast%      whether to use fast mode (0 no)
  2147.  
  2148. Name  : DGetSt               (Direct-from-memory Get String)
  2149. Class : String
  2150. Level : Clone
  2151.  
  2152. The DGetSt routine allows you to get a string from a specified
  2153. area of memory (numeric array, BIOS data area, display memory,
  2154. or whatever).  The string should be initialized to the desired
  2155. length in advance.
  2156.  
  2157. You may specify an additional offset from the initial location,
  2158. which itself is specified as a segment and an offset.  The
  2159. second offset begins with position 1.  The combined total of
  2160. the two offsets must be under 65,536 at the moment.  I'll
  2161. remove that restriction at a later time.  With normalized
  2162. segment and offset specifications, which is usually the case,
  2163. this allows you to specify a number from 1-65,521 for the
  2164. second offset.
  2165.  
  2166.    DGetSt DSeg%, DOfs%, Posn&, St$
  2167.  
  2168. DSeg%      segment of the array to read from
  2169. DOfs%      offset of the array to read from
  2170. Posn&      location relative to the start of the array
  2171. -------
  2172. St$        returned string.  Init to # of chars desired.
  2173.  
  2174. Name  : DGQPrint             (Direct Graphics Quick Print)
  2175. Class : Display
  2176. Level : Any
  2177.  
  2178. This is a simple high-speed replacement for the PRINT statement
  2179. which works on a CGA virtual graphics screen (SCREEN 2).  It
  2180. does not interpret control codes or support graphics characters
  2181. (ASCII 128-255).
  2182.  
  2183. DGQPrint allows you to display to a CGA even if it isn't the
  2184. active display (use a segment of &HB800 and offset of 0).  Its
  2185. intended use, however, is to display to a virtual screen kept
  2186. in an array or other memory area.  The results can then be
  2187. displayed using GrafRest.
  2188.  
  2189.    DGQPrint DSeg%, DOfs%, St$, Row%, Column%
  2190.  
  2191. DSeg%    segment of CGA virtual screen
  2192. DOfs%    offset of CGA virtual screen
  2193. St$      string to display
  2194. Row%     row (1-25)
  2195. Column%  column (1-80)
  2196.  
  2197. Name  : DGXQPrint            (Direct Graphics Extended Q Print)
  2198. Class : Display
  2199. Level : Any
  2200.  
  2201. This is a simple high-speed replacement for the PRINT statement
  2202. which works on a CGA virtual graphics screen (SCREEN 1).  It
  2203. does not interpret control codes or support graphics characters
  2204. (ASCII 128-255).
  2205.  
  2206. This routine can also be used on a SCREEN 2 display, where it
  2207. will display the string in shades instead of in color (using 40
  2208. columns/row).
  2209.  
  2210. DGXQPrint allows you to display to a CGA even if it isn't the
  2211. active display (use a segment of &HB800 and offset of 0).  Its
  2212. intended use, however, is to display to a virtual screen kept
  2213. in an array or other memory area.  The results can then be
  2214. displayed using GrafRest.
  2215.  
  2216.    DGXQPrint DSeg%, DOfs%, St$, Row%, Column%, Fore%
  2217.  
  2218. DSeg%    segment of CGA virtual screen
  2219. DOfs%    offset of CGA virtual screen
  2220. St$      string to display
  2221. Row%     row (1-25)
  2222. Column%  column (1-40)
  2223. Fore%    foreground color (0-3)
  2224.  
  2225. Name  : DGXQPrint1           (Direct Graphics Extended Q Print)
  2226. Class : Display
  2227. Level : Any
  2228.  
  2229. This is a high-speed replacement for the PRINT statement which
  2230. works on a CGA virtual graphics screen (SCREEN 1). It does not
  2231. interpret control codes.
  2232.  
  2233. This routine can also be used on a SCREEN 2 display, where it
  2234. will display the string in shades instead of in color (using 40
  2235. columns/row).
  2236.  
  2237. DGXQPrint1 allows you to display to a CGA even if it isn't the
  2238. active display (use a segment of &HB800 and offset of 0).  Its
  2239. intended use, however, is to display to a virtual screen kept
  2240. in an array or other memory area.  The results can then be
  2241. displayed using GrafRest.
  2242.  
  2243.    DGXQPrint1 DSeg%, DOfs%, St$, Row%, Column%, Fore%, Back%
  2244.  
  2245. DSeg%    segment of CGA virtual screen
  2246. DOfs%    offset of CGA virtual screen
  2247. St$      string to display
  2248. Row%     row (1-25)
  2249. Column%  column (1-40)
  2250. Fore%    foreground color (0-3)
  2251. Back%    background color (0-3)
  2252.  
  2253. Name  : DInput               (Dollar Input)
  2254. Class : Input
  2255. Level : Clone
  2256.  
  2257. This routine provides formatted input of a dollar amount.  You
  2258. specify the format and an initial value (may be zero).  You may
  2259. also specify whether to allow negation-- if so, the user may
  2260. press the "-" key to toggle the number between negative and
  2261. positive.  The numeric keypad will automatically be locked into
  2262. the numeric state.  Since the decimal point is implicit, the
  2263. "." key functions as a delete or backspace operation, for
  2264. convenient one-handed data entry and correction.
  2265.  
  2266. The dollar amount is kept in a long integer as a number of
  2267. pennies, to avoid the possibility of round-off errors which
  2268. might result from use of floating point math.  The results are
  2269. returned to you both as a long integer and as a formatted
  2270. number.
  2271.  
  2272. The format string works just like a PRINT USING format string.
  2273. Editing is not as flexible as for SInput, but is quite
  2274. adequate.  The SInputSet routines will work for DInput as well
  2275. as SInput.  The ExitCode% returned is the same as for SInput,
  2276. but left and right arrows may also be returned.
  2277.  
  2278.    DInput Format$, St&, St$, MinusOk%, VAttr%, ExitCode%
  2279.  
  2280. Format$    numeric format (just like PRINT USING format)
  2281. St&        dollar amount (in pennies)
  2282. MinusOk%   whether negation is allowed (0 if no)
  2283. VAttr%     color/attribute to use (see CalcAttr)
  2284. -------
  2285. St&        dollar amount (in pennies)
  2286. St$        formatted dollar amount
  2287. ExitCode%  key used to exit (ASCII code if +, scan code if -)
  2288.  
  2289. Name  : DiskStat             (Disk Statistics)
  2290. Class : Disk
  2291. Level : DOS
  2292.  
  2293. DiskStat gives you statistics on the memory usage of a
  2294. specified disk drive: the total number of clusters, the number
  2295. of available or free clusters, the number of sectors per
  2296. cluster, and the number of bytes per sector.
  2297.  
  2298. From this information, you can determine how much total disk
  2299. space there is, how much space is left and how much is used,
  2300. the size of a cluster, et al.
  2301.  
  2302. A few formulas for you:
  2303.  
  2304.    ClusterSize% = BytesPerSec% * SecsPerClus%
  2305.    FreeSpace& = FreeClus& * ClusterSize%
  2306.    TotalSpace& = TotalClus& * ClusterSize%
  2307.    UsedSpace& = TotalSpace& - FreeSpace&
  2308.  
  2309. A "cluster" is the minimum amount of disk space that can be
  2310. allocated at a time.  A typical cluster size for a medium-sized
  2311. hard drive is 2048 bytes, which means that any file from 1-2048
  2312. bytes in length is actually taking up a full 2048 bytes on the
  2313. disk.  Large cluster sizes improve file access times but can
  2314. waste a lot of disk space.
  2315.  
  2316.    DiskStat Drive$, FreeClus&, TotalClus&, BytesPerSec%,
  2317.       SecsPerClus%
  2318.  
  2319. Drive$        letter of the drive to examine
  2320. -------
  2321. FreeClus&     number of free or available clusters
  2322. TotalClus&    total number of clusters
  2323. BytesPerSec%  bytes per sector
  2324. SecsPerClus%  sectors per cluster (-1 if bad drive, etc)
  2325.  
  2326. Name  : Dissolve             (Dissolve)
  2327. Class : Display
  2328. Level : Clone
  2329.  
  2330. Like CLS, but a bit more fancy, this routine provides an
  2331. interesting way to clear the screen.  See also FadeOut.
  2332.  
  2333. This routine may cause heavy flickering on some CGA displays.
  2334.  
  2335.    Dissolve VAttr%
  2336.  
  2337. VAttr%   color/attribute to which to clear (see CalcAttr)
  2338.  
  2339. Name  : DMPrint              (DOS Message Print)
  2340. Class : Display
  2341. Level : DOS
  2342.  
  2343. This routine is similar to PRINT, but goes through DOS output
  2344. services, which allows your program to support output
  2345. redirection, filters, CTTY and other handy things.  See
  2346. DOSInkey for a DOS input service.
  2347.  
  2348. Note that the use of DMPrint means that you should avoid using
  2349. BASIC display handling (CLS, INPUT, LINE INPUT, PRINT, LOCATE,
  2350. CSRLIN, POS, etc).  Instead, you should use ANSI escape
  2351. sequences to control the display.  This requires that an ANSI
  2352. driver (like ANSI.SYS, DVANSI.SYS, NANSI.SYS, or ZANSI.SYS) be
  2353. installed on your system.  See your DOS manual for details on
  2354. ANSI sequences, or grab the documentation on ANSI from one of
  2355. your friendly local BBSes.
  2356.  
  2357. It is -possible- to use BASIC display handling in conjunction
  2358. with DMPrint, but that tends to defeat the purpose of using
  2359. DMPrint in the first place.
  2360.  
  2361. Note that the DMPrint routine does not add a carriage
  2362. return/linefeed to the end of a string.  If you want that, add
  2363. CHR$(13) + CHR$(10) to the end of the string.
  2364.  
  2365.    DMPrint St$
  2366.  
  2367. St$    string to display
  2368.  
  2369. Name  : DOSClrEol            (DOS Clear to End Of Line)
  2370. Class : Display
  2371. Level : DOS
  2372.  
  2373. This routine clears from the cursor position to the end of the
  2374. row using DOS output functions.  It requires that ANSI.SYS or
  2375. another ANSI driver be installed.
  2376.  
  2377.    DOSClrEol
  2378.  
  2379. Name  : DOSCls               (DOS Clear Screen)
  2380. Class : Display
  2381. Level : DOS
  2382.  
  2383. This routine clears the screen using DOS output functions.  It
  2384. requires that ANSI.SYS or another ANSI driver be installed.
  2385.  
  2386.    DOSCls
  2387.  
  2388. Name  : DOSColor             (DOS Color)
  2389. Class : Display
  2390. Level : DOS
  2391.  
  2392. This routine sets the screen colors using DOS output
  2393. functions.  It requires that ANSI.SYS or another ANSI driver be
  2394. installed.
  2395.  
  2396.    DOSColor Fore%, Back%
  2397.  
  2398. Fore%    foreground color
  2399. Back%    background color
  2400.  
  2401. Name  : DOSErrM$             (DOS Error Message)
  2402. Class : Miscellaneous
  2403. Level : DOS
  2404.  
  2405. Of the many PBClone routines that return error codes, most
  2406. simply pass the code back from DOS without any processing.  You
  2407. can see what the codes mean by checking the chart in
  2408. PBClone.DOC, or it may be more convenient to use DOSErrM$
  2409. instead.  This routine returns a short text description of the
  2410. error in question.
  2411.  
  2412.    ErrMsg$ = DOSErrM$(ErrCode%)
  2413.  
  2414. ErrCode%     error code to translate
  2415. -------
  2416. ErrMsg$      brief explanation of the error
  2417.  
  2418. Name  : DOSInkey             (DOS INKEY$)
  2419. Class : Input
  2420. Level : DOS
  2421.  
  2422. This routine is similar to INKEY$, but goes through DOS input
  2423. services, which allows your program to support input
  2424. redirection, filters, CTTY and other handy things.  See DMPrint
  2425. for a DOS output service.  See also DOSInky$.
  2426.  
  2427.    DOSInkey CharCode%, CharType%
  2428.  
  2429. -------
  2430. CharType%    0 if no key, 1 if normal key, 2 if extended key
  2431. CharCode%    ASCII code if normal key, scan code if extended key
  2432.  
  2433. Name  : DOSInky$             (DOS INKEY$)
  2434. Class : Input
  2435. Level : DOS
  2436.  
  2437. This routine works just like INKEY$, but goes through DOS input
  2438. services, which allows your program to support input
  2439. redirection, filters, CTTY and other handy things.  See DMPrint
  2440. for a DOS output service.  See also DOSInkey.
  2441.  
  2442.    ky$ = DOSInky$
  2443.  
  2444. -------
  2445. ky$      key, if any was waiting (0-2 chars/key, like INKEY$)
  2446.  
  2447. Name  : DOSInt%              (DOS Interrupt)
  2448. Class : Miscellaneous
  2449. Level : DOS
  2450.  
  2451. This routine provides you with easy access to DOS functions via
  2452. INT 21H, the major DOS interrupt.  It works like the CALL
  2453. INTERRUPT routines provided with QuickBASIC but is easier to
  2454. use, at the expense of some flexibility.
  2455.  
  2456. CAUTION: This routine works directly with DOS, bypassing most
  2457. of BASIC's safety precautions.  Possible chaos may result if
  2458. you don't know what you're doing!  A few specific caveats:
  2459.  
  2460.    1) Do Not use this routine to exit your program or execute
  2461.       another.  BASIC needs to clean up after itself before
  2462.       these tasks, and bypassing its handling is liable to make
  2463.       the system unstable at best.
  2464.  
  2465.    2) If you expect to use a string or array as a buffer, make
  2466.       sure it is long enough to handle the maximum amount of
  2467.       information anticipated. Strings and arrays can move
  2468.       about in memory, so be sure to get their addresses Just
  2469.       Before using DOSInt%.
  2470.  
  2471. If you wish to specify BASIC's data segment for DS, you can
  2472. find out what that is using the DataSeg routine (q.v.).
  2473.  
  2474. Normally, the CarryFlag% will be set if there is an error, in
  2475. which case AX will return the error code.
  2476.  
  2477.    CarryFlag% = DOSInt%(AX%, BX%, CX%, DX%, DS%)
  2478.  
  2479. AX%         desired setting of the AX register
  2480. BX%         desired setting of the BX register
  2481. CX%         desired setting of the CX register
  2482. DX%         desired setting of the DX register
  2483. DS%         desired setting of the DS and ES registers
  2484. -------
  2485. AX%         returned setting of the AX register
  2486. BX%         returned setting of the BX register
  2487. CX%         returned setting of the CX register
  2488. DX%         returned setting of the DX register
  2489. DS%         returned setting of the DS and ES registers
  2490. CarryFlag%  returned carry flag (0 no error, else code in AX)
  2491.  
  2492. Name  : DOSLocate            (DOS Locate)
  2493. Class : Display
  2494. Level : DOS
  2495.  
  2496. This routine sets the cursor position using DOS output
  2497. functions.  It requires that ANSI.SYS or another ANSI driver be
  2498. installed.
  2499.  
  2500. Note that many ANSI drivers do not fully support EGA or VGA
  2501. modes in that they are limited to a maximum of 25 rows.
  2502.  
  2503.    DOSLocate Row%, Column%
  2504.  
  2505. Row%      row
  2506. Column%   column
  2507.  
  2508. Name  : DPutRec              (Direct-to-memory Put Record)
  2509. Class : String
  2510. Level : Clone
  2511.  
  2512. The DPutRec routine allows you to put a string into a specified
  2513. area of memory (numeric array, BIOS data area, display memory,
  2514. or whatever).  The string should be initialized to the desired
  2515. record length in advance.
  2516.  
  2517. This works somewhat like an array of fixed length strings or a
  2518. random file, treating memory as a contiguous series of records
  2519. of a specified length.
  2520.  
  2521.    DPutRec DSeg%, DOfs%, RecNr%, St$
  2522.  
  2523. DSeg%      segment of the array to write into
  2524. DOfs%      offset of the array to write into
  2525. RecNr%     record number (starting at 1)
  2526. St$        string to write.  Init to record length (see above).
  2527.  
  2528. Name  : DPutScreen           (Direct-from-memory Put Screen)
  2529. Class : Display
  2530. Level : Clone
  2531.  
  2532. This routine restores a portion of the display (which was saved
  2533. to an array by DGetScreen or GetScreen) to the screen.  Only
  2534. text modes are supported. If your program uses multiple display
  2535. pages, you can put the image onto any of those pages.  A
  2536. special "slow" mode is supported for the CGA, to prevent
  2537. flickering (a problem only with some CGAs).
  2538.  
  2539. The PutScreen routine works the same way as this, but has a
  2540. simpler calling convention.  Also, if you wish to restore the
  2541. entire screen, you may find ScrRest easier (see).
  2542.  
  2543.    DPutScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2544.       Page%, Fast%
  2545.  
  2546. DSeg%      segment of the array from which to restore the image
  2547. DOfs%      offset of the array from which to restore the image
  2548. TRow%      top row of the desired screen area
  2549. LCol%      left column of the desired screen area
  2550. BRow%      bottom row of the desired screen area
  2551. RCol%      right column of the desired screen area
  2552. Page%      page on which to restore the display
  2553. Fast%      whether to use fast mode (0 no)
  2554.  
  2555. Name  : DPutSt               (Direct-to-memory Put String)
  2556. Class : String
  2557. Level : Clone
  2558.  
  2559. The DPutSt routine allows you to put a string into a specified
  2560. area of memory (numeric array, BIOS data area, display memory,
  2561. or whatever).
  2562.  
  2563. You may specify an additional offset from the initial location,
  2564. which itself is specified as a segment and an offset.  The
  2565. second offset begins with position 1.  The combined total of
  2566. the two offsets must be under 65,536 at the moment.  I'll
  2567. remove that restriction at a later time.  With normalized
  2568. segment and offset specifications, which is usually the case,
  2569. this allows you to specify a number from 1-65,521 for the
  2570. second offset.
  2571.  
  2572.    DPutSt DSeg%, DOfs%, Posn&, St$
  2573.  
  2574. DSeg%      segment of the array to write to
  2575. DOfs%      offset of the array to write to
  2576. Posn&      location relative to the start of the array
  2577. St$        string to write into memory
  2578.  
  2579. Name  : DReadAbs             (Disk Read Absolute)
  2580. Class : Disk
  2581. Level : DOS
  2582.  
  2583. This routine reads an absolute disk sector.  This is about as
  2584. low-level as you can get-- the disk is read directly at the
  2585. byte level, bypassing higher-level notions like filenames and
  2586. directories.
  2587.  
  2588. The DReadAbs routine works with any version of DOS, but will
  2589. not work properly with disk partitions of over 32 megabytes.
  2590. If you need to work with large disks, see the DReadAbsBig
  2591. routine.
  2592.  
  2593. The results from the read will be stored in an array or other
  2594. memory area you specify.  Be sure to make the area large enough
  2595. to hold everything!  A sector is usually 512 bytes, but you can
  2596. use the DiskStat routine to make sure. Logical sector numbering
  2597. is used, with sector numbers beginning at zero.
  2598.  
  2599.    DReadAbs Drive$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  2600.  
  2601. Drive$     drive letter
  2602. Sector&    starting sector (0-65534 [or less on most disks])
  2603. DSeg%      segment of the array
  2604. DOfs%      offset of the array
  2605. Sectors%   number of sectors to read
  2606. -------
  2607. ErrCode%   error code (0 if no error, else DOS error code)
  2608.  
  2609. Name  : DReadAbsBig          (Disk Read Absolute, Big)
  2610. Class : Disk
  2611. Level : DOS
  2612.  
  2613. This routine reads an absolute disk sector.  This is about as
  2614. low-level as you can get-- the disk is read directly at the
  2615. byte level, bypassing higher-level notions like filenames and
  2616. directories.
  2617.  
  2618. The DReadAbsBig routine works with DOS 3.31 and later.  It will
  2619. work on disks of any size.  If a limit of 32M is sufficient,
  2620. you might prefer the DReadAbs routine, which works with any DOS
  2621. version.
  2622.  
  2623. The results from the read will be stored in an array or other
  2624. memory area you specify.  Be sure to make the area large enough
  2625. to hold everything!  A sector is usually 512 bytes, but you can
  2626. use the DiskStat routine to make sure. Logical sector numbering
  2627. is used, with sector numbers beginning at zero.
  2628.  
  2629.    DReadAbsBig Driv$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  2630.  
  2631. Driv$      drive letter
  2632. Sector&    starting sector (0-65534 [or less on most disks])
  2633. DSeg%      segment of the array
  2634. DOfs%      offset of the array
  2635. Sectors%   number of sectors to read
  2636. -------
  2637. ErrCode%   error code (0 if no error, else DOS error code)
  2638.  
  2639. Name  : DRecDel              (Direct-to-memory Record Deletion)
  2640. Class : Array management
  2641. Level : Any
  2642.  
  2643. This routine allows you to delete an item from an array.  The
  2644. item may consist of one or more array elements.  The size of
  2645. the array isn't actually changed, but the array elements are
  2646. moved as if a deletion took place.
  2647.  
  2648.    DRecDel DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2649.  
  2650. DSeg%      segment of the array
  2651. DOfs%      offset of the array
  2652. RecNr%     record/element number (starting at 1)
  2653. RecLen%    record/element length in bytes
  2654. Records%   total number of records/elements in the array
  2655.  
  2656. Name  : DRecIns              (Direct-to-mem Record Insertion)
  2657. Class : Array management
  2658. Level : Any
  2659.  
  2660. This routine allows you to insert an item into an array.  The
  2661. item may consist of one or more array elements.  The size of
  2662. the array isn't actually changed, but the array elements are
  2663. moved as if an insertion took place.  You must of course make
  2664. sure that the array is DIMed large enough to handle this.
  2665.  
  2666.    DRecIns DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2667.  
  2668. DSeg%      segment of the array
  2669. DOfs%      offset of the array
  2670. RecNr%     record/element number (starting at 1)
  2671. RecLen%    record/element length in bytes
  2672. Records%   total number of records/elements in the array
  2673.  
  2674. Name  : DRecolor             (Direct-to-memory Recolor)
  2675. Class : Display
  2676. Level : Any
  2677.  
  2678. The DRecolor routine changes all text in one color to another
  2679. color.  It works only in text modes.  The colors are specified
  2680. as attributes (see CalcAttr).
  2681.  
  2682. This routine does not necessarily work on the display itself.
  2683. Instead, it allows you to specify the memory location (segment
  2684. and offset) of the "screen", which may be an actual screen, a
  2685. saved screen in an array, a multitasker's virtual screen, etc.
  2686. Among other things, this makes it easy to work with two
  2687. displays at once: use a segment of &HB000 for the mono display
  2688. and &HB800 for the color display (the offset in each case is
  2689. zero).
  2690.  
  2691.    DRecolor DSeg%, DOfs%, OldAttr%, NewAttr%
  2692.  
  2693. DSeg%      segment of "screen" memory
  2694. DOfs%      offset of "screen" memory
  2695. OldAttr%   color to be changed
  2696. NewAttr%   color to which to change
  2697.  
  2698. Name  : DRecolorArea         (Direct-to-memory Recolor Area)
  2699. Class : Display
  2700. Level : Clone
  2701.  
  2702. The DRecolorArea routine changes a specified area of the screen
  2703. to a specified color.  It works only in text modes.  The color
  2704. is specified as an attribute (see CalcAttr).
  2705.  
  2706. One of the more common applications for this routine is marking
  2707. an area of the screen, e.g. menu highlight bars.
  2708.  
  2709.    DRecolorArea DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  2710.      VAttr%
  2711.  
  2712. This routine does not necessarily work on the display itself.
  2713. Instead, it allows you to specify the memory location (segment
  2714. and offset) of the "screen", which may be an actual screen, a
  2715. saved screen in an array, a multitasker's virtual screen, etc.
  2716. Among other things, this makes it easy to work with two
  2717. displays at once: use a segment of &HB000 for the mono display
  2718. and &HB800 for the color display (the offset in each case is
  2719. zero).
  2720.  
  2721. DSeg%       segment of "screen" memory
  2722. DOfs%       offset of "screen" memory
  2723. TRow%       top row of area to recolor
  2724. LCol%       left column of area to recolor
  2725. BRow%       bottom row of area to recolor
  2726. RCol%       right column of area to recolor
  2727. VAttr%      desired color
  2728.  
  2729. Name  : DriveSpace&          (Drive Space free)
  2730. Class : Disk
  2731. Level : DOS
  2732.  
  2733. This routine tells you how many bytes are free on a specified
  2734. disk drive.
  2735.  
  2736.    BytesFree& = DriveSpace&(Drive$)
  2737.  
  2738. Drive$      letter of the drive to examine
  2739. -------
  2740. BytesFree&  free bytes on the specified drive, or -1 if error
  2741.  
  2742. Name  : DrvSpaceL            (Drive Space free as Long integer)
  2743. Class : Disk
  2744. Level : DOS
  2745.  
  2746. This routine tells you how many bytes are free on a specified
  2747. disk drive. See also DriveSpace, a function-type version of
  2748. this routine.
  2749.  
  2750.    DrvSpaceL Drive$, BytesFree&
  2751.  
  2752. Drive$      letter of the drive to examine
  2753. -------
  2754. BytesFree&  free bytes on the specified drive, or -1 if error
  2755.  
  2756. Name  : DrvType              (Drive Type)
  2757. Class : Disk
  2758. Level : DOS 3.1+
  2759.  
  2760. The DrvType routine tells you whether a specified drive is
  2761. fixed or removeable, and whether it is local or remote (network
  2762. drive).
  2763.  
  2764.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  2765.  
  2766. Drive$       letter of the drive to examine
  2767. -------
  2768. Removeable%  whether the disk can be removed (0 if no)
  2769. Remote%      whether this is a remote drive (0 if no)
  2770. ErrCode%     error code: 0 if none, else bad DOS version
  2771.  
  2772. Name  : DScrRest             (Direct-from-mem Screen Restore)
  2773. Class : Display
  2774. Level : Clone
  2775.  
  2776. The DScrRest routine restores a display that was saved using
  2777. ScrSave or a similar routine.  It only works in text modes.
  2778. See also ScrRest.
  2779.  
  2780.    DScrRest DSeg%, DOfs%, Page%, Fast%
  2781.  
  2782. DSeg%      segment of info to restore to the screen
  2783. DOfs%      offset of info to restore to the screen
  2784. Page%      page on which to restore the display
  2785. Fast%      whether to use fast mode (0 no)
  2786.  
  2787. Name  : DScrSave             (Direct-from-memory Screen Save)
  2788. Class : Display
  2789. Level : Clone
  2790.  
  2791. The DScrSave routine saves the display to an array or other
  2792. storage area. Only text modes are supported.  For an 80x25
  2793. display, the array must hold 4,000 bytes (4,000 string
  2794. characters or 2,000 integers).  See also ScrSave.
  2795.  
  2796.    DScrSave DSeg%, DOfs%, Page%, Fast%
  2797.  
  2798. DSeg%      segment of place to store the display
  2799. DOfs%      offset of place to store the display
  2800. Page%      page from which to get the display
  2801. Fast%      whether to use fast mode (0 no)
  2802.  
  2803. Name  : DTR                  (Data Terminal Ready signal)
  2804. Class : Serial
  2805. Level : Clone
  2806.  
  2807. Just as IBM provided the standard for personal computers, Hayes
  2808. provided the standard for modem commands.  Unfortunately, the
  2809. command method of dropping carrier (hanging up the phone) was
  2810. badly designed, and all Hayes-compatible modems have a hard
  2811. time recognizing that command under certain line conditions.
  2812.  
  2813. Fortunately, there's a more reliable way of hanging up: the DTR
  2814. serial signal.  Turning this signal off will cause the modem to
  2815. hang up very quickly.  Most Hayes-compatible modems are
  2816. factory-set to pay attention to the DTR; those that aren't can
  2817. be made to do so either by flipping a hardware switch or with a
  2818. special initialization command.  See your modem manual for
  2819. details.
  2820.  
  2821. BASIC will drop the DTR when you CLOSE the comm port, but this
  2822. isn't always a convenient way to do it.  As a matter of fact,
  2823. this can be a decided nuisance, so many people have patched
  2824. their version of BASIC to avoid it.  If you would like to do
  2825. so, check your local BBS for the method!  With the PBClone DTR
  2826. routine, you can get full control over the DTR without having
  2827. to CLOSE the comm port.
  2828.  
  2829. Note: it may be wise to include a brief delay after dropping
  2830. the DTR, to give the modem a chance to react.  Try Delay18th
  2831. (see) with a wait of around 4.
  2832.  
  2833.    DTR CommPort%, TurnOn%
  2834.  
  2835. CommPort%    serial port (1-4, though BASIC only handles 1-2)
  2836. TurnOn%      whether to raise (turn on) the DTR (0 if no)
  2837.  
  2838. Name  : DupeVar              (Duplicate Variable)
  2839. Class : Miscellaneous
  2840. Level : Any
  2841.  
  2842. This routine allows you to copy the contents of one variable
  2843. into another, even if the variables are not of the same type.
  2844. You may specify any variable type EXCEPT variable-length
  2845. strings: integer, long integer, single, double, fixed-length
  2846. string, TYPEd variable, etc.
  2847.  
  2848. Most languages that provide TYPEd variables also provide for
  2849. variant records, that is, more than one way of looking at the
  2850. same information.  Curiously, BASIC doesn't.  This routine
  2851. allows you to map one variable into another, essentially
  2852. providing the lacking capability.
  2853.  
  2854. The only caveat for DupeVar is that both variables must be the
  2855. same length in bytes.
  2856.  
  2857.    DupeVar FromVar, ToVar
  2858.  
  2859. FromVar     variable from which to copy
  2860. -------
  2861. ToVar       variable to which to copy
  2862.  
  2863. Name  : DWindowMan2          (Direct-to-memory Window Manager)
  2864. Class : Display
  2865. Level : Any
  2866.  
  2867. This routine is identical to DWindowManager but for the fact
  2868. that it allows you to design your own custom window frames.
  2869. Please see the description of DWindowManager for general
  2870. information.
  2871.  
  2872. These are the additional frame types:
  2873.     6   custom frame composed of a single character
  2874.     7   custom frame composed of the specified 7-character list:
  2875.         top left corner, top middle, top right corner,
  2876.         left middle, right middle,
  2877.         bottom left corner, bottom middle, bottom right corner
  2878.  
  2879.  /------------------------------------------------------------\
  2880.  | A custom frame like this would be defined as frame type 7, |
  2881.  | with a frame string of "/-\||\-/", for instance.           |
  2882.  \------------------------------------------------------------/
  2883.  
  2884.  *************************************************
  2885.  * On the other hand, a frame like this would be *
  2886.  * frame type 6, with a frame string of "*".     *
  2887.  *************************************************
  2888.  
  2889. Note that this routine differs from the ProBas equivalent in
  2890. that it supports full frame definitions through frame type 7
  2891. (ProBas only supports type 6). The other differences mentioned
  2892. under WindowManager are also relevant.
  2893.  
  2894.    DWindowMan2 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2895.       Frame%, FSt$, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  2896.  
  2897. DSeg%       segment of "screen" memory
  2898. DOfs%       offset of "screen" memory
  2899. TRow%       top row of window
  2900. LCol%       left column of window
  2901. BRow%       bottom row of window
  2902. RCol%       right column of window
  2903. Frame%      frame type (see above)
  2904. FSt$        frame definition string (see above)
  2905. Fore%       frame foreground color
  2906. Back%       frame background color
  2907. Grow%       window growing option (see above)
  2908. Shade%      window shadow option (see above)
  2909. TFore%      title foreground color
  2910. Title$      window title ("" if none)
  2911.  
  2912. Name  : DWindowMan3          (Direct-to-memory Window Manager)
  2913. Class : Display
  2914. Level : Any
  2915.  
  2916. This routine is identical in function to DWindowManager.  The
  2917. parameters are mostly passed as an array, however, instead of
  2918. one by one.  Please see the description of DWindowManager for
  2919. general information.
  2920.  
  2921.    DWindowMan3 Parm%(), Title$
  2922.  
  2923. DSeg%       segment of "screen" memory
  2924. DOfs%       offset of "screen" memory
  2925. Parm%(1)    top row of window
  2926. Parm%(2)    left column of window
  2927. Parm%(3)    bottom row of window
  2928. Parm%(4)    right column of window
  2929. Parm%(5)    frame type (see above)
  2930. Parm%(6)    frame foreground color
  2931. Parm%(7)    frame background color
  2932. Parm%(8)    window growing option (see above)
  2933. Parm%(9)    window shadow option (see above)
  2934. Parm%(10)   title foreground color
  2935. Title$      window title ("" if none)
  2936.  
  2937. Name  : DWindowMan4          (Direct-to-memory Window Manager)
  2938. Class : Display
  2939. Level : Any
  2940.  
  2941. This is an extremely cut-down version of DWindowManager,
  2942. providing no more than a simple frame generator.
  2943.  
  2944. These are the available frame types:
  2945.     0   no frame
  2946.     1   single lines
  2947.     2   double lines
  2948.     3   single horizontal, double vertical lines
  2949.     4   double horizontal, single vertical lines
  2950.     5   block graphic lines
  2951.  
  2952. Note that this routine is different from its ProBas equivalent
  2953. in that a new frame type (5) is available.
  2954.  
  2955.    DWindowMan4 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  2956.       Frame%, VAttr%
  2957.  
  2958. DSeg%       segment of "screen" memory
  2959. DOfs%       offset of "screen" memory
  2960. TRow%       top row of window
  2961. LCol%       left column of window
  2962. BRow%       bottom row of window
  2963. RCol%       right column of window
  2964. Frame%      frame type (see above)
  2965. VAttr%      frame color/attribute (use CalcAttr)
  2966.  
  2967. Name  : DWindowManager       (Direct-to-memory Window Manager)
  2968. Class : Display
  2969. Level : Any
  2970.  
  2971. DWindowManager displays a pop-up window according to your
  2972. specifications. The window may have any of a variety of frames,
  2973. a title, or a shadow, and it may appear instantly or "grow"
  2974. onto the screen.
  2975.  
  2976. These are the available frame types:
  2977.     0   no frame
  2978.     1   single lines
  2979.     2   double lines
  2980.     3   single horizontal, double vertical lines
  2981.     4   double horizontal, single vertical lines
  2982.     5   block graphic lines
  2983.  
  2984. These are the available shadows:
  2985.    -3   transparent shadow on the right
  2986.    -2   transparent shadow on the left
  2987.    -1   solid black shadow on the left
  2988.     0   no shadow
  2989.    1+   shadow attribute (use CalcAttr) for a colored shadow
  2990.  
  2991. Options for growing windows are as follows:
  2992.    -1   grow as fast as possible
  2993.     0   pop onto the screen
  2994.    1+   grow with delay given in milliseconds (15 works for me)
  2995.  
  2996. Note that this routine is different from its ProBas equivalent
  2997. in a number of respects.  The grow delay time is different.
  2998. Growing is done more smoothly. The shadow and title parameters
  2999. are not changed by this routine.  A new frame type (5) was
  3000. added.  If a title is too long, it is truncated instead of
  3001. being ignored completely.  Using a -1 as the title foreground
  3002. color will not turn off the title; instead, use a null title
  3003. string.
  3004.  
  3005.    DWindowManager DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  3006.       Frame%, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  3007.  
  3008. This routine does not necessarily work on the display itself.
  3009. Instead, it allows you to specify the memory location (segment
  3010. and offset) of the "screen", which may be an actual screen, a
  3011. saved screen in an array, a multitasker's virtual screen, etc.
  3012. Among other things, this makes it easy to work with two
  3013. displays at once: use a segment of &HB000 for the mono display
  3014. and &HB800 for the color display (the offset in each case is
  3015. zero).
  3016.  
  3017. DSeg%       segment of "screen" memory
  3018. DOfs%       offset of "screen" memory
  3019. TRow%       top row of window
  3020. LCol%       left column of window
  3021. BRow%       bottom row of window
  3022. RCol%       right column of window
  3023. Frame%      frame type (see above)
  3024. Fore%       frame foreground color
  3025. Back%       frame background color
  3026. Grow%       window growing option (see above)
  3027. Shade%      window shadow option (see above)
  3028. TFore%      title foreground color
  3029. Title$      window title ("" if none)
  3030.  
  3031. Name  : DWriteAbs             (Disk Write Absolute)
  3032. Class : Disk
  3033. Level : DOS
  3034.  
  3035. This routine writes an absolute disk sector.  This is about as
  3036. low-level as you can get-- the disk is written directly at the
  3037. byte level, bypassing higher-level notions like filenames and
  3038. directories.  This is DANGEROUS!  If you screw up, DOS may not
  3039. be able to read the disk any more, and it may need to be
  3040. reformatted.  Back up your data before trying this routine!
  3041.  
  3042. The DWriteAbs routine works with any version of DOS, but will
  3043. not work properly with disk partitions of over 32 megabytes.
  3044. If you need to work with large disks, see the DWriteAbsBig
  3045. routine.
  3046.  
  3047. The write will be done from an array or other memory area you
  3048. specify.  Be sure to make the area the right size!  A sector is
  3049. usually 512 bytes, but you can use the DiskStat routine to make
  3050. sure.  Logical sector numbering is used, with sector numbers
  3051. beginning at zero.
  3052.  
  3053.    DWriteAbs Drive$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  3054.  
  3055. Drive$     drive letter
  3056. Sector&    starting sector (0-65534 [or less on most disks])
  3057. DSeg%      segment of the array
  3058. DOfs%      offset of the array
  3059. Sectors%   number of sectors to write
  3060. -------
  3061. ErrCode%   error code (0 if no error, else DOS error code)
  3062.  
  3063. Name  : DWriteAbsBig          (Disk Write Absolute, Big)
  3064. Class : Disk
  3065. Level : DOS
  3066.  
  3067. This routine writes an absolute disk sector.  This is about as
  3068. low-level as you can get-- the disk is written directly at the
  3069. byte level, bypassing higher-level notions like filenames and
  3070. directories.  This is DANGEROUS!  If you screw up, DOS may not
  3071. be able to read the disk any more, and it may need to be
  3072. reformatted.  Back up your data before trying this routine!
  3073.  
  3074. The DWriteAbsBig routine works with DOS 3.31 and later.  It will
  3075. work on disks of any size.  If a limit of 32M is sufficient,
  3076. you might prefer the DWriteAbs routine, which works with any DOS
  3077. version.
  3078.  
  3079. The write will be done from an array or other memory area you
  3080. specify.  Be sure to make the area the right size!  A sector is
  3081. usually 512 bytes, but you can use the DiskStat routine to make
  3082. sure.  Logical sector numbering is used, with sector numbers
  3083. beginning at zero.
  3084.  
  3085.    DWriteAbsBig Drv$, Sector&, DSeg%, DOfs%, Sectors%, ErrCode%
  3086.  
  3087. Drv$       drive letter
  3088. Sector&    starting sector (0-65534 [or less on most disks])
  3089. DSeg%      segment of the array
  3090. DOfs%      offset of the array
  3091. Sectors%   number of sectors to write
  3092. -------
  3093. ErrCode%   error code (0 if no error, else DOS error code)
  3094.  
  3095. Name  : DXQPrint             (Direct Extended Quick Print)
  3096. Class : Display
  3097. Level : Any
  3098.  
  3099. This routine provides a rather crude, but very fast, display
  3100. capability.  It works like the PRINT statement in BASIC, except
  3101. that it doesn't move the cursor or process control codes.  It
  3102. works only in text modes.
  3103.  
  3104. This routine does not necessarily work on the display itself.
  3105. Instead, it allows you to specify the memory location (segment
  3106. and offset) of the "screen", which may be an actual screen, a
  3107. saved screen in an array, a multitasker's virtual screen, etc.
  3108. Among other things, this makes it easy to work with two
  3109. displays at once: use a segment of &HB000 for the mono display
  3110. and &HB800 for the color display (the offset in each case is
  3111. zero).
  3112.  
  3113.    DXQPrint DSeg%, DOfs%, St$, Row%, Column%, VAttr%
  3114.  
  3115. DSeg%     segment of "screen" memory
  3116. DOfs%     offset of "screen" memory
  3117. St$       string to display
  3118. Row%      starting row
  3119. Column%   starting column
  3120. VAttr%    color/attribute (see CalcAttr)
  3121.  
  3122. Name  : EGARest7             (EGA Restore for SCREEN 7)
  3123. Class : Display
  3124. Level : Clone
  3125.  
  3126. This routine allows you to restore a SCREEN 7 (EGA, 320x200, 16
  3127. color) display that was saved using EGASave7 (see).
  3128.  
  3129.    EGARest7 DSeg%, DOfs%
  3130.  
  3131. DSeg%        segment of storage array, returned by VARSEG
  3132. DOfs%        offset  of storage array, returned by VARPTR
  3133.  
  3134. Name  : EGARest8             (EGA Restore for SCREEN 8)
  3135. Class : Display
  3136. Level : Clone
  3137.  
  3138. This routine allows you to restore a SCREEN 8 (EGA, 640x200, 16
  3139. color) display that was saved using EGASave8 (see).
  3140.  
  3141.    EGARest8 DSeg%, DOfs%
  3142.  
  3143. DSeg%        segment of storage array, returned by VARSEG
  3144. DOfs%        offset  of storage array, returned by VARPTR
  3145.  
  3146. Name  : EGARest9             (EGA Restore for SCREEN 9)
  3147. Class : Display
  3148. Level : Clone
  3149.  
  3150. This routine allows you to restore a SCREEN 9 (EGA, 640x350, 16
  3151. color) display that was saved using EGASave9 (see).
  3152.  
  3153.    EGARest9 DSeg1%, DOfs1%, DSeg2%, DOfs2%
  3154.  
  3155. DSeg1%       segment of storage array #1, returned by VARSEG
  3156. DOfs1%       offset  of storage array #1, returned by VARPTR
  3157. DSeg2%       segment of storage array #2, returned by VARSEG
  3158. DOfs2%       offset  of storage array #2, returned by VARPTR
  3159.  
  3160. Name  : EGASave7             (EGA Save for SCREEN 7)
  3161. Class : Display
  3162. Level : Clone
  3163.  
  3164. This routine allows you to save a SCREEN 7 (EGA, 320x200, 16
  3165. color) display that can be restored using EGARest7 (see).
  3166.  
  3167. The array used to hold the screen must contain 32,000 bytes.
  3168. For an integer array, this means that you must create the array
  3169. by DIM Array%(1 TO 16000).
  3170.  
  3171.    EGASave7 DSeg%, DOfs%
  3172.  
  3173. DSeg%        segment of storage array, returned by VARSEG
  3174. DOfs%        offset  of storage array, returned by VARPTR
  3175.  
  3176. Name  : EGASave8             (EGA Save for SCREEN 8)
  3177. Class : Display
  3178. Level : Clone
  3179.  
  3180. This routine allows you to save a SCREEN 8 (EGA, 640x200, 16
  3181. color) display that can be restored using EGARest8 (see).
  3182.  
  3183. The array used to hold the screen must contain 64,000 bytes.
  3184. For an integer array, this means that you must create the array
  3185. by DIM Array%(1 TO 32000).
  3186.  
  3187.    EGASave8 DSeg%, DOfs%
  3188.  
  3189. DSeg%        segment of storage array, returned by VARSEG
  3190. DOfs%        offset  of storage array, returned by VARPTR
  3191.  
  3192. Name  : EGASave9             (EGA Save for SCREEN 9)
  3193. Class : Display
  3194. Level : Clone
  3195.  
  3196. This routine allows you to save a SCREEN 9 (EGA, 640x350, 16
  3197. color) display that can be restored using EGARest9 (see).
  3198.  
  3199. Two arrays must be used to hold the screen, for a total of
  3200. 112,000 bytes.  If you use integer arrays, each array must be
  3201. created by DIM Array%(1 TO 28000).
  3202.  
  3203.    EGASave9 DSeg%, DOfs%
  3204.  
  3205. DSeg1%       segment of storage array #1, returned by VARSEG
  3206. DOfs1%       offset  of storage array #1, returned by VARPTR
  3207. DSeg2%       segment of storage array #2, returned by VARSEG
  3208. DOfs2%       offset  of storage array #2, returned by VARPTR
  3209.  
  3210. Name  : Elapsed              (Elapsed time)
  3211. Class : Time
  3212. Level : Any
  3213.  
  3214. This routine tells you the amount of time elapsed between a
  3215. given starting time and ending time.  The difference between
  3216. the times must be less than 24 hours for the results to be
  3217. meaningful.
  3218.  
  3219. See also ElapsedTime, the FUNCTION version of this routine.
  3220.  
  3221.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  3222.  
  3223. TimeStart$   starting time
  3224. TimeStop$    ending time
  3225. -------
  3226. TimeDiff$    elapsed time
  3227.  
  3228. Name  : ElapsedTime$         (Elapsed time)
  3229. Class : Time
  3230. Level : Any
  3231.  
  3232. This routine tells you the amount of time elapsed between a
  3233. given starting time and ending time.  The difference between
  3234. the times must be less than 24 hours for the results to be
  3235. meaningful.
  3236.  
  3237. See also Elapsed, the SUB version of this routine.
  3238.  
  3239.    TimeDiff$ = ElapsedTime$(TimeStart$, TimeStop$)
  3240.  
  3241. TimeStart$   starting time
  3242. TimeStop$    ending time
  3243. -------
  3244. TimeDiff$    elapsed time
  3245.  
  3246. Name  : EMSBuffer            (EMS Buffer size)
  3247. Class : Memory
  3248. Level : BIOS
  3249.  
  3250. EMSBuffer tells you how many bytes are needed to save the state
  3251. of the EMS array routines.  Used in conjunction with EMSSave
  3252. and EMSRest, it allows you to preserve EMS arrays across a
  3253. CHAIN to another part of your program.
  3254.  
  3255.    EMSBuffer Bytes%
  3256.    EMSState$ = SPACE$(Bytes%)
  3257.    EMSSave EMSState$
  3258.  
  3259. -------
  3260. Bytes%       bytes needed to save EMS array state
  3261.  
  3262. Name  : EMSClose             (EMS Close)
  3263. Class : Memory
  3264. Level : BIOS
  3265.  
  3266. The EMSClose routine is used when you are finished with an EMS
  3267. array.  It frees the array handle and EMS memory for other
  3268. uses.  If you don't close all EMS arrays before your program
  3269. ends, the memory will be lost until the system is rebooted, so
  3270. it is important to remember EMSClose.
  3271.  
  3272.    EMSClose ArrayHandle%
  3273.  
  3274. ArrayHandle%    handle of an EMS array
  3275.  
  3276. Name  : EMSGet               (EMS Get)
  3277. Class : Memory
  3278. Level : BIOS
  3279.  
  3280. This routine gets an element from an EMS array created by
  3281. EMSOpen.  Element numbers start at 0.  Be sure to use the right
  3282. numeric type for the array-- for instance, if you opened the
  3283. array for SINGLE precision, use "Value!".
  3284.  
  3285.    EMSGet ArrayHandle%, ElementNr&, Value
  3286.  
  3287. ArrayHandle%    handle of an EMS array
  3288. ElementNr&      element number to get
  3289. -------
  3290. Value           result (must be correct type for array)
  3291.  
  3292. Name  : EMSOpen              (EMS Open)
  3293. Class : Memory
  3294. Level : BIOS
  3295.  
  3296. This routine allows you to open a block of EMS (expanded)
  3297. memory which can then be accessed like a numeric array.  The
  3298. array size is limited only by available EMS memory (use GetLIMM
  3299. to find out how much is available).  You may specify any
  3300. numeric type:
  3301.  
  3302.     1   INTEGER
  3303.     2   LONG or SINGLE
  3304.     3   DOUBLE
  3305.  
  3306. When the array is opened, you are returned an "array handle"
  3307. which is used to access that array.  Access to the array is
  3308. done via EMSGet and EMSPut.  When you are finished with the
  3309. array, you must close it with EMSClose.
  3310.  
  3311. As many as 25 EMS arrays can be in use at one time, subject to
  3312. limitations which may be imposed by your EMS driver (each array
  3313. requires one EMS handle).
  3314.  
  3315.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  3316.  
  3317. Elements&       number of elements in array (like DIM size)
  3318. ElementType%    numeric type of array (see above)
  3319. -------
  3320. ArrayHandle%    handle of an EMS array
  3321. ErrCode%        whether an error occurred (0 no)
  3322.  
  3323. Name  : EMSPut               (EMS Put)
  3324. Class : Memory
  3325. Level : BIOS
  3326.  
  3327. This routine puts an element into an EMS array created by
  3328. EMSOpen.  Element numbers start at 0.  Be sure to use the right
  3329. numeric type for the array-- for instance, if you opened the
  3330. array for SINGLE precision, use "Value!".
  3331.  
  3332.    EMSPut ArrayHandle%, ElementNr&, Value
  3333.  
  3334. ArrayHandle%    handle of an EMS array
  3335. ElementNr&      element number to set
  3336. Value           value to store (must be correct type for array)
  3337.  
  3338. Name  : EMSRest              (EMS Restore state)
  3339. Class : Memory
  3340. Level : BIOS
  3341.  
  3342. This routine allows you to restore the state of the EMS array
  3343. handler.  Used in conjunction with EMSBuffer and EMSSave, it
  3344. allows you to preserve EMS arrays across a CHAIN to another
  3345. part of your program.
  3346.  
  3347.    EMSRest EMSState$
  3348.  
  3349. EMSState$    saved EMS array state
  3350.  
  3351. Name  : EMSSave              (EMS Save state)
  3352. Class : Memory
  3353. Level : BIOS
  3354.  
  3355. This routine allows you to save the state of the EMS array
  3356. handler.  Used in conjunction with EMSBuffer and EMSRest, it
  3357. allows you to preserve EMS arrays across a CHAIN to another
  3358. part of your program.
  3359.  
  3360.    EMSBuffer Bytes%
  3361.    EMSState$ = SPACE$(Bytes%)
  3362.    EMSSave EMSState$
  3363.  
  3364. -------
  3365. EMSState$    saved EMS array state
  3366.  
  3367. Name  : EnhKbd               (Enhanced Keyboard)
  3368. Class : Input
  3369. Level : BIOS
  3370.  
  3371. By default, the PBClone routines assume an old-style keyboard
  3372. is in use, for greatest compatibility.  EnhKbd allows you to
  3373. turn on enhanced keyboard handling for the current generation
  3374. of (usually) 101-key keyboards.  This allows access to the F11
  3375. and F12 function keys as well as codes for key combinations
  3376. that used to be ignored, among other things.
  3377.  
  3378. The KbdType or KbdType2% routine can be used to determine if an
  3379. enhanced keyboard is available (recommended).
  3380.  
  3381. Note that EnhKbd works by intercepting the BIOS keyboard
  3382. handler.  All calls to the BIOS keyboard interrupt are
  3383. converted from the old keyboard functions to the new ones.  YOU
  3384. MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can restore
  3385. the old setup.  Otherwise, the computer will most probably
  3386. crash.
  3387.  
  3388. A list of the new key codes is given in PBClone.DOC.
  3389.  
  3390.    EnhKbd Enable%
  3391.  
  3392. Enable%     turn on enhanced keyboard support (0 disable)
  3393.  
  3394. Name  : Equipment            (Equipment information)
  3395. Class : Equipment
  3396. Level : BIOS
  3397.  
  3398. This routine gives you some information about the basic
  3399. equipment in your computer.  Note that the "game port"
  3400. information is not reliable, due to changes in the meaning of
  3401. this particular area of the BIOS over many years.
  3402.  
  3403.    Equipment Memory%, Parallel%, Serial%, Game%
  3404.  
  3405. -------
  3406. Memory%    kilobytes of conventional memory installed (16 - 640)
  3407. Parallel%  parallel (printer) ports installed (0-4)
  3408. Serial%    serial (communications) ports installed (0-4)
  3409. Game%      game (joystick) ports installed (0-1).  See remarks, above.
  3410.  
  3411. Name  : EuropeDate           (European Date format)
  3412. Class : Time
  3413. Level : Any
  3414.  
  3415. This routine takes a date in one of the American formats
  3416. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  3417. convention ("DD.MM.YY" or "DD.MM.YYYY").  The date is formatted
  3418. according to a format string which provides the desired
  3419. delimiter and year length, e.g. "##-##-##" specifies a
  3420. delimiter of "-" and a year length of two digits.
  3421.  
  3422. An error code is returned if the date is not valid.
  3423.  
  3424.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  3425.  
  3426. DateSt$     date to format (month, day, year order)
  3427. Format$     format for the date
  3428. -------
  3429. Result$     resulting date (day, month, year order)
  3430. ErrCode     whether the date is valid (0 ok)
  3431.  
  3432. Name  : EWindowManagerC      (EGA Window Manager w Char coords)
  3433. Class : Display
  3434. Level : Clone
  3435.  
  3436. EWindowManagerC displays a pop-up window according to your
  3437. specifications. The window may have any of a variety of frames,
  3438. a title, or a shadow, and it may appear instantly or "grow"
  3439. onto the screen.  EGA and VGA graphics modes (SCREEN 7 through
  3440. SCREEN 12) are supported.
  3441.  
  3442. These are the available frame types:
  3443.     0   no frame
  3444.     1   single lines
  3445.     2   double lines
  3446.     3   single horizontal, double vertical lines
  3447.     4   double horizontal, single vertical lines
  3448.     5   block graphic lines
  3449.  
  3450. These are the available shadows:
  3451.     0   no shadow
  3452.    1+   shadow attribute (use CalcAttr) for a colored shadow
  3453.  
  3454. Options for growing windows are as follows:
  3455.    -1   grow as fast as possible
  3456.     0   pop onto the screen
  3457.    1+   grow with delay given in milliseconds (not recommended)
  3458.  
  3459. The differences between this routine and its ProBas equivalent
  3460. are the same as mentioned in the description for
  3461. WindowManager.  In addition, growing windows are supported, but
  3462. are not recommended (too slow).  Colored shadows work as in
  3463. WindowManager.  "True" shadows are not yet supported.
  3464.  
  3465.    EWindowManagerC TRow%, LCol%, BRow%, RCol%, Frame%,
  3466.       Fore%, Back%, Grow%, Shade%, S1%, S2%, TFore%, Title$
  3467.  
  3468. TRow%       top row of window
  3469. LCol%       left column of window
  3470. BRow%       bottom row of window
  3471. RCol%       right column of window
  3472. Frame%      frame type (see above)
  3473. Fore%       frame foreground color
  3474. Back%       frame background color
  3475. Grow%       window growing option (see above)
  3476. Shade%      window shadow option (see above)
  3477. S1%         unused
  3478. S2%         unused
  3479. TFore%      title foreground color
  3480. Title$      window title ("" if none)
  3481.  
  3482. Name  : Exist                (file Existence)
  3483. Class : Disk
  3484. Level : DOS
  3485.  
  3486. Most versions of BASIC give you no way of seeing if a file
  3487. exists before you try to OPEN it, so you end up taking your
  3488. chances.  The Exist routine allows you to test to see if the
  3489. file exists beforehand.  It isn't really necessary for the
  3490. PBClone file routines, which will return an appropriate error
  3491. code, but it's an important safeguard when using the BASIC OPEN
  3492. statement.
  3493.  
  3494. The Exist routine does not support wildcards.  If you need that
  3495. feature, try the FindFirstFx and FindNextFx routines instead.
  3496.  
  3497. See also Exist2, the FUNCTION version of this routine.
  3498.  
  3499.    Exist FileName$, Found%
  3500.  
  3501. FileName$   name of the file to look for
  3502. -------
  3503. Found%      whether the file was found (0 if no)
  3504.  
  3505. Name  : Exist2%              (file Existence)
  3506. Class : Disk
  3507. Level : DOS
  3508.  
  3509. Most versions of BASIC give you no way of seeing if a file
  3510. exists before you try to OPEN it, so you end up taking your
  3511. chances.  The Exist2% function allows you to test to see if the
  3512. file exists beforehand.  It isn't really necessary for the
  3513. PBClone file routines, which will return an appropriate error
  3514. code, but it's an important safeguard when using the OPEN
  3515. statement.
  3516.  
  3517. The Exist2% routine does not support wildcards.  If you need
  3518. that feature, try the FindFirstFx and FindNextFx routines
  3519. instead.
  3520.  
  3521. See also Exist, the SUB version of this routine.
  3522.  
  3523.    Found% = Exist2%(FileName$)
  3524.  
  3525. FileName$   name of the file to look for
  3526. -------
  3527. Found%      whether the file was found (0 if no)
  3528.  
  3529. Name  : ExplainFAttr$        (Explain File Attribute)
  3530. Class : Disk
  3531. Level : Any
  3532.  
  3533. This function returns a string explaining what a file attribute
  3534. means, using a specified level of abbreviation.  A single space
  3535. is used between each word, e.g. a hidden subdirectory at
  3536. abbreviation level 2 would be "Hid Dir".
  3537.  
  3538. Abbreviation Levels:
  3539.         1           2              3
  3540.    ---------------------------------------
  3541.  1      R          R-O         Read-Only
  3542.  2      H          Hid         Hidden
  3543.  4      S          Sys         System
  3544.  8      V          Vol         Volume
  3545. 16      D          Dir         Directory
  3546. 32      A          Arc         Archive
  3547.  
  3548. This function is convenient in conjunction with any of the
  3549. routines which return a file attribute: GetAttrF, GetAttrFx,
  3550. GetFAttr, LoadDirAll.
  3551.  
  3552.    Info$ = ExplainFAttr$(FilAttr%, AbbrevLevel%)
  3553.  
  3554. We use FilAttr% instead of FileAttr%, since BASIC has a
  3555. built-in FILEATTR function.
  3556.  
  3557. FilAttr%      file attribute
  3558. -------
  3559. AbbrevLevel%  how much to abbreviate the result (1-3)
  3560.  
  3561. Name  : EXQPrintC            (EGA Extended Quick Print, Char)
  3562. Class : Display
  3563. Level : Clone
  3564.  
  3565. This routine provides a rather crude, but very fast, display
  3566. capability.  It works like the PRINT statement in BASIC, except
  3567. that it doesn't move the cursor or process control codes.  It
  3568. works in EGA and VGA graphics modes (SCREEN 7 through SCREEN
  3569. 12).
  3570.  
  3571.    EXQPrintC St$, Row%, Column%, Fore%, Back%
  3572.  
  3573. St$       string to display
  3574. Row%      starting row
  3575. Column%   starting column
  3576. Fore%     foreground color
  3577. Back%     background color
  3578.  
  3579. Name  : ExtendFSpec          (Extend File Specification)
  3580. Class : Disk
  3581. Level : DOS
  3582.  
  3583. The ExtendFSpec routine combines a number of handy services
  3584. together.  It is intended for processing user-entered file
  3585. specifications.  It does the following:
  3586.  
  3587.    1) Makes sure the filespec is valid
  3588.    2) Formats the filespec to normal DOS standards
  3589.    3) Tells you whether the drive and subdirectories
  3590.       specified exist
  3591.    4) Fills out any drive or subdirectory information that
  3592.       was left out (optionally includes adding an extension
  3593.       to files which lack one)
  3594.  
  3595. The error codes returned are as follows:
  3596.    -1    Invalid file specification
  3597.     0    No error
  3598.     1    Specified drive does not exist (warning only)
  3599.     2    Specified subdirectory does not exist (warning only)
  3600.  
  3601. The ExtendFSpec routine mimics DOS filename handling exactly,
  3602. to the best of my knowledge.
  3603.  
  3604.    ExtendFSpec File$, Ext$, FullFile$, ErrCode%
  3605.  
  3606. File$      file specification to process
  3607. Ext$       extension to add to files that don't have extensions
  3608. -------
  3609. FullFile$  processed file specification
  3610. ErrCode%   error code
  3611.  
  3612. Name  : ExtGet               (Extended memory Get)
  3613. Class : Memory
  3614. Level : BIOS (AT)
  3615.  
  3616. This routine allows you to get information from extended
  3617. memory.  It should only be used on AT-class computers, since
  3618. older PCs do not support extended memory.
  3619.  
  3620. You may get up to 32,766 words (just under 64 kilobytes) at a
  3621. time from a specified location in extended memory.  The
  3622. location is specified as the distance from the start of
  3623. extended memory, starting at 1 for the first location.  One
  3624. word is equivalent to one integer.
  3625.  
  3626. See ExtMem for information on extended memory constraints.
  3627.  
  3628.    ExtGet DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3629.  
  3630. DSeg%       segment of array to place data from extended memory
  3631. DOfs%       offset of array to place data from extended memory
  3632. Posn&       location of data in extended memory (starting at 1)
  3633. Words%      # of words to transfer (1 int = 1 word = 2 byte)
  3634. -------
  3635. ErrCode%    error code (0 if no error)
  3636.  
  3637. Name  : ExtMem               (Extended Memory)
  3638. Class : Memory / Equipment
  3639. Level : BIOS (AT)
  3640.  
  3641. This routine allows you to find out how much extended memory is
  3642. available. It should only be used on AT-class computers, since
  3643. older PCs do not support extended memory.
  3644.  
  3645. The amount of memory returned may be either the total amount of
  3646. extended memory installed or just the amount available at this
  3647. time, depending on how previously-installed programs (if any)
  3648. make use of extended memory. Unfortunately, there is no
  3649. standard which defines how a program should use extended memory
  3650. as there is with EMS (expanded memory), so there is no way for
  3651. a program to determine whether or how another program is using
  3652. extended memory.  Microsoft is trying to clear up this
  3653. situation with its HIMEM driver (available at your local BBS,
  3654. or [last I looked] free from Microsoft), but this approach
  3655. hasn't really become standard yet.
  3656.  
  3657.    ExtMem KBytes%
  3658.  
  3659. -------
  3660. KBytes%     the number of kilobytes of extended memory
  3661.  
  3662. Name  : ExtPut               (Extended memory Put)
  3663. Class : Memory
  3664. Level : BIOS (AT)
  3665.  
  3666. This routine allows you to put information into extended
  3667. memory.  It should only be used on AT-class computers, since
  3668. older PCs do not support extended memory.
  3669.  
  3670. You may put up to 32,766 words (just under 64 kilobytes) at a
  3671. time into a specified location in extended memory.  The
  3672. location is specified as the distance from the start of
  3673. extended memory, starting at 1 for the first location.  One
  3674. word is equivalent to one integer.
  3675.  
  3676. Note that you can't rely on extended memory being available
  3677. just because it exists.  There is no automatic way to determine
  3678. if another program is also trying to use the same extended
  3679. memory.  If in doubt, allow a user-installed option to
  3680. enable/disable the use of extended memory by your program.
  3681.  
  3682.    ExtPut DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3683.  
  3684. DSeg%       segment of data to store in extended memory
  3685. DOfs%       offset of data to store in extended memory
  3686. Posn&       location to place data in extended memory
  3687. Words%      # of words to transfer (1 int = 1 word = 2 bytes)
  3688. -------
  3689. ErrCode%    error code (0 if no error)
  3690.  
  3691. Name  : Extract              (Extract delimited substring)
  3692. Class : String
  3693. Level : Any
  3694.  
  3695. Extract allows you to remove any one of a list of delimited
  3696. substrings in a string.  It's useful for input parsing and
  3697. database work.  You pass it the string, delimiter, and the
  3698. number of the desired substring (numbers start at one).  It
  3699. returns the starting position of the substring within the
  3700. string and the length of the substring (0 if not found).
  3701.  
  3702. Just for example, let's assume we have a string as follows:
  3703.    St$ = "Tom Hanlin=3544 E. Southern Ave #104=Mesa, AZ 85204"
  3704.  
  3705. If we selected a delimiter of "=" and substring number three,
  3706. the results would be "Mesa, AZ 85204".
  3707.  
  3708. Delimiters of more than one character are fine.  This can be
  3709. handy for locating carriage return/linefeed pairs, among other
  3710. things.
  3711.  
  3712.    Extract St$, Delimiter$, SubStrNr%, StartPosn%, SLen%
  3713.    SubSt$ = MID$(St$, StartPosn%, SLen%)
  3714.  
  3715. St$         string from which to extract
  3716. Delimiter$  delimiter between substrings
  3717. SubStrNr%   number of the desired substring
  3718. -------
  3719. StartPosn%  starting position of substring within the string
  3720. SLen%       length of the substring (0 if none)
  3721.  
  3722. Name  : FadeOut              (Fade Out)
  3723. Class : Display
  3724. Level : Clone
  3725.  
  3726. Like CLS, but a bit more fancy, this routine provides an
  3727. interesting way to clear the screen.  See also Dissolve.
  3728.  
  3729.    FadeOut VAttr%
  3730.  
  3731. VAttr%   color/attribute to which to clear (see CalcAttr)
  3732.  
  3733. Name  : FarPeek%             (Far memory Peek)
  3734. Class : Memory
  3735. Level : Clone
  3736.  
  3737. This is like the BASIC PEEK function, but expects both a
  3738. segment and an offset, thus doing away with the need for DEF
  3739. SEG.  This is especially handy for use in subprograms which
  3740. might otherwise inadvertently change the DEF SEG value expected
  3741. by the main program.
  3742.  
  3743.    Value% = FarPeek%(DSeg%, DOfs%)
  3744.  
  3745. Related routines include FarPeekI%, FarPeekL&, DGetSt, DGetRec.
  3746.  
  3747. DSeg%    segment of the location to look at
  3748. DOfs%    offset of the location to look at
  3749. -------
  3750. Value%   value at the specified memory location (byte: 0-255)
  3751.  
  3752. Name  : FarPeekI%            (Far memory Peek Integer)
  3753. Class : Memory
  3754. Level : Clone
  3755.  
  3756. This is like the BASIC PEEK function, but expects both a
  3757. segment and an offset, thus doing away with the need for DEF
  3758. SEG.  This is especially handy for use in subprograms which
  3759. might otherwise inadvertently change the DEF SEG value expected
  3760. by the main program.  Unlike PEEK, this routine returns a word
  3761. (integer) rather than a byte.
  3762.  
  3763.    Value% = FarPeekI%(DSeg%, DOfs%)
  3764.  
  3765. Related routines include FarPeek%, FarPeekL&, DGetSt, DGetRec.
  3766.  
  3767. DSeg%    segment of the location to look at
  3768. DOfs%    offset of the location to look at
  3769. -------
  3770. Value%   value at the specified memory location (word)
  3771.  
  3772. Name  : FarPeekL&            (Far memory Peek Long integer)
  3773. Class : Memory
  3774. Level : Clone
  3775.  
  3776. This is like the BASIC PEEK function, but expects both a
  3777. segment and an offset, thus doing away with the need for DEF
  3778. SEG.  This is especially handy for use in subprograms which
  3779. might otherwise inadvertently change the DEF SEG value expected
  3780. by the main program.  Unlike PEEK, this routine returns a dword
  3781. (long integer) rather than a byte.
  3782.  
  3783.    Value& = FarPeekL&(DSeg%, DOfs%)
  3784.  
  3785. Related routines include FarPeek%, FarPeekI%, DGetSt, DGetRec.
  3786.  
  3787. DSeg%    segment of the location to look at
  3788. DOfs%    offset of the location to look at
  3789. -------
  3790. Value&   value at the specified memory location (dword)
  3791.  
  3792. Name  : FarPoke              (Far memory Poke)
  3793. Class : Memory
  3794. Level : Clone
  3795.  
  3796. This is like the BASIC POKE statement, but expects both a
  3797. segment and an offset, thus doing away with the need for DEF
  3798. SEG.  This is especially handy for use in subprograms which
  3799. might otherwise inadvertently change the DEF SEG value expected
  3800. by the main program.
  3801.  
  3802.    FarPoke DSeg%, DOfs%, Value%
  3803.  
  3804. Related routines include FarPokeI, FarPokeL, DPutSt, DPutRec.
  3805.  
  3806. DSeg%    segment of the location to look at
  3807. DOfs%    offset of the location to look at
  3808. Value%   value to store in the given memory posn (byte: 0-255)
  3809.  
  3810. Name  : FarPokeI             (Far memory Poke Integer)
  3811. Class : Memory
  3812. Level : Clone
  3813.  
  3814. This is like the BASIC POKE statement, but expects both a
  3815. segment and an offset, thus doing away with the need for DEF
  3816. SEG.  This is especially handy for use in subprograms which
  3817. might otherwise inadvertently change the DEF SEG value expected
  3818. by the main program.  Unlike POKE, this routine stores a word
  3819. or integer.
  3820.  
  3821.    FarPokeI DSeg%, DOfs%, Value%
  3822.  
  3823. Related routines include FarPoke, FarPokeL, DPutSt, DPutRec.
  3824.  
  3825. DSeg%    segment of the location to look at
  3826. DOfs%    offset of the location to look at
  3827. Value%   value to store in the given memory posn (word)
  3828.  
  3829. Name  : FarPokeL             (Far memory Poke Long integer)
  3830. Class : Memory
  3831. Level : Clone
  3832.  
  3833. This is like the BASIC POKE statement, but expects both a
  3834. segment and an offset, thus doing away with the need for DEF
  3835. SEG.  This is especially handy for use in subprograms which
  3836. might otherwise inadvertently change the DEF SEG value expected
  3837. by the main program.  Unlike POKE, this routine stores a dword
  3838. or long integer.
  3839.  
  3840.    FarPokeL DSeg%, DOfs%, Value&
  3841.  
  3842. Related routines include FarPoke, FarPokeI, DPutSt, DPutRec.
  3843.  
  3844. DSeg%    segment of the location to look at
  3845. DOfs%    offset of the location to look at
  3846. Value&   value to store in the given memory posn (dword)
  3847.  
  3848. Name  : FClose1              (File Close)
  3849. Class : Disk
  3850. Level : DOS
  3851.  
  3852. This routine closes a file that was opened by FOpen1 or
  3853. FCreate.  It can also be used to close any of the predefined
  3854. device handles.
  3855.  
  3856. These are the predefined device handles that are always
  3857. available:
  3858.  
  3859.    0    CON     stdin     standard input, normally the keyboard
  3860.    1    CON     stdout    standard output, normally the display
  3861.    2    CON     stderr    standard error, almost always display
  3862.    3    AUX     stdaux    auxiliary device, generally COM1
  3863.    4    PRN     stdprn    standard printer, generally LPT1
  3864.  
  3865. If you are running short of handles, you can always close
  3866. stdaux to free up a handle.  The stdprn device can also be
  3867. closed as long as you don't use the printer or if you only
  3868. access the printer through LPRINT.  It is not a good idea to
  3869. close stdin, stdout, or stderr under normal circumstances.
  3870.  
  3871.    FClose1 Handle%
  3872.  
  3873. Handle%    handle of the file to close
  3874.  
  3875. Name  : FCreate              (File Create)
  3876. Class : Disk
  3877. Level : DOS
  3878.  
  3879. This routine creates a file and opens it for use by the PBClone
  3880. file handling routines.  If the file already existed, it will
  3881. be wiped out, so you may want to check beforehand if this is a
  3882. problem.  Try the Exist routine.
  3883.  
  3884. The file is opened in read/write mode, allowing both input and
  3885. output.
  3886.  
  3887. You may create the file using any of the following attributes:
  3888.  
  3889.    Normal          0      (nothing special)
  3890.    Read Only       1      file can be read, but not written to
  3891.    Hidden          2      file is "invisible"
  3892.    System          4      special DOS system file
  3893.  
  3894. The attributes can be combined by adding them together.  Don't
  3895. use the System attribute unless you know what you're doing!
  3896.  
  3897. Note that this routine does not support file sharing.  If that
  3898. is a problem, close the file just after it is created and
  3899. reopen it using FOpen1.
  3900.  
  3901.    FCreate FileName$, FAttr%, Handle%, ErrCode%
  3902.  
  3903. FileName$  name of the file to create
  3904. FAttr%     attribute(s) of the file
  3905. -------
  3906. Handle%    handle by which to access the file (if no error)
  3907. ErrCode%   error code: 0 if no error, else DOS Error
  3908.  
  3909. Name  : FDescRead$           (File Description Read)
  3910. Class : Disk
  3911. Level : DOS
  3912.  
  3913. This routine reads a 4DOS-style file description from disk.  If
  3914. there is no description or an error occurs, the result will be
  3915. a null string.
  3916.  
  3917.    FileDesc$ = FDescRead$(FileName$)
  3918.  
  3919. FileName$   file name
  3920. -------
  3921. FileDesc$   description of file, if any
  3922.  
  3923. Name  : FGetLoc              (File Get Location)
  3924. Class : Disk
  3925. Level : DOS
  3926.  
  3927. This routine tells you the position of the file pointer of a
  3928. file that was opened using FOpen1 or FCreate.  This pointer is
  3929. used to specify where the next item should be read from or
  3930. written to the file.  The first location of the file is
  3931. numbered 1.
  3932.  
  3933. See also FGetLoc2, the FUNCTION version of this routine.
  3934.  
  3935.    FGetLoc Handle%, Posn&
  3936.  
  3937. Handle%    handle of the file
  3938. -------
  3939. Posn&      location of the file pointer
  3940.  
  3941. Name  : FGetLoc2&            (File Get Location)
  3942. Class : Disk
  3943. Level : DOS
  3944.  
  3945. This routine tells you the position of the file pointer of a
  3946. file that was opened using FOpen1 or FCreate.  This pointer is
  3947. used to specify where the next item should be read from or
  3948. written to the file.  The first location of the file is
  3949. numbered 1.
  3950.  
  3951. See also FGetLoc, the SUB version of this routine.
  3952.  
  3953.    Posn& = FGetLoc2&(Handle%)
  3954.  
  3955. Handle%    handle of the file
  3956. -------
  3957. Posn&      location of the file pointer
  3958.  
  3959. Name  : FileCopy             (File Copy)
  3960. Class : Disk
  3961. Level : DOS
  3962.  
  3963. This routine copies one or more files, just like the DOS
  3964. command "COPY".
  3965.  
  3966. FileCopy works exactly like the DOS COPY command, except it
  3967. won't append files.  You may use wildcards in both source and
  3968. destination file specifications.  In the event of an error,
  3969. normal DOS error codes are returned, with two exceptions:
  3970.  
  3971.   -2  attempt to copy files over themselves
  3972.   -1  attempt to copy multiple sources to a single dest file
  3973.  
  3974. See also CopyFile, a simpler routine which doesn't support
  3975. wildcards.
  3976.  
  3977.    FileCopy SrcFile$, DestFile$, FCount%, ByteCount&, ErrCode%
  3978.  
  3979. SrcFile$    source file name(s)
  3980. DestFile$   destination file name(s)
  3981. -------
  3982. FCount%     number of files copied
  3983. ByteCount&  number of bytes copied
  3984. ErrCode%    error code (0 if no error)
  3985.  
  3986. Name  : FileCount            (File Count)
  3987. Class : Disk
  3988. Level : DOS
  3989.  
  3990. This routine returns the number of files which match a given
  3991. file specification and attribute.  You need to use this routine
  3992. before LoadDir or LoadDirAll in order to DIM the array to the
  3993. appropriate size.
  3994.  
  3995. The attribute can be any of the usual file attributes:
  3996.    1   Read-Only
  3997.    2   Hidden
  3998.    4   System
  3999.   16   Directory
  4000.  
  4001. You can combine attributes by adding their values.  For
  4002. instance, to search for hidden directories, you'd use an
  4003. attribute of 18.  By default, DOS returns normal files as well
  4004. as files which have the specified attributes, so an attribute
  4005. of 18 would get you normal files, hidden files, directories,
  4006. and hidden directories.  However, FileCount can be made to
  4007. screen out unwanted files-- just negate the attribute to force
  4008. only files of that attribute to be counted.  For example, an
  4009. attribute of -18 would return only hidden subdirectories.
  4010.  
  4011.    FileCount FileSpec$, FilAttr%, Count%, ErrCode%
  4012.  
  4013. We use FilAttr% instead of FileAttr%, since BASIC has a
  4014. built-in FILEATTR function.
  4015.  
  4016. FileSpec$   search filename (may contain wildcards)
  4017. FilAttr%    search file attribute
  4018. -------
  4019. Count%      number of matching files found
  4020. ErrCode%    error code (0 if no error)
  4021.  
  4022. Name  : FileCRC              (File CRC)
  4023. Class : Disk
  4024. Level : DOS
  4025.  
  4026. This routine calculates a 32-bit CRC for a file.  This CRC is
  4027. derived by a formula which takes each character of the file
  4028. into consideration.  It provides a powerful (although not 100%
  4029. foolproof) way to verify that a file hasn't changed since you
  4030. last checked.
  4031.  
  4032.    FileCRC FileName$, Result&, ErrCode%
  4033.  
  4034. FileName$   source file name(s)
  4035. -------
  4036. Result&     32-bit CRC of the file
  4037. ErrCode%    error code (0 if no error)
  4038.  
  4039. Name  : FileMenu             (File Menu)
  4040. Class : Input
  4041. Level : Clone
  4042.  
  4043. This routine provides a list of files according to the filespec
  4044. and attribute you pass it and allows the user to pick a single
  4045. file from the resulting list.  The filespec may contain a full
  4046. path and wildcards.  The attribute may be negated if you insist
  4047. on an exact match (directories only, for example), or use a
  4048. normal attribute for multiple matches (directories and files,
  4049. for instance).  Many of the usual WindowManager parameters are
  4050. used here-- top row, left column, and bottom row (right column
  4051. is calculated for you), window frame color and frame type,
  4052. growth, shadow, title string and title color-- see the
  4053. WindowManager routine for details.  For a description of file
  4054. search attributes, see the FindFirstFx routine.
  4055.  
  4056. If you allow using the mouse, be sure the mouse is initialized
  4057. (MMCheck or MMCheck2%) and the mouse cursor is visible
  4058. (MMCursorOn) before calling this routine.
  4059.  
  4060. This routine automatically saves and restores the underlying
  4061. screen.  It can handle up to 2,048 files in a window.  See
  4062. CalcAttr if you're not familiar with color/attributes.
  4063.  
  4064.    FileMenu Mouse%, FileSpec$, SeekAttr%, TopRow%, LeftCol%, _
  4065.       BottomRow%, Frame%, FrameAttr%, FileListAttr%, _
  4066.       HiliteAttr%, TitleFore%, Title$, Grow%, Shade%
  4067.  
  4068. Mouse%          whether to support the mouse (0 no, -1 yes)
  4069. FileSpec$       filespec to use in creating the file list
  4070. SeekAttr%       file search attribute to use in creating list
  4071. TopRow%         top row of pick window
  4072. LeftCol%        left column of pick window
  4073. BottomRow%      bottom row of pick window
  4074. Frame%          frame type
  4075. FrameAttr%      frame color/attribute
  4076. FileListAttr%   file list color/attribute
  4077. HiliteAttr%     highlight bar color/attribute
  4078. TitleFore%      title foreground color (backgnd is frame color)
  4079. Title$          title (use "" for no title)
  4080. Grow%           window growth
  4081. Shade%          window shadow
  4082. -------
  4083. FileSpec$       file picked ("" if none)
  4084.  
  4085. Name  : FindFirstA           (Find First file in an Archive)
  4086. Class : Disk
  4087. Level : DOS
  4088.  
  4089. The FindFirstA routine is used to find the first file that
  4090. matches search parameters which you specify.  Various
  4091. information about the file that matches (if any) can be
  4092. retrieved by other routines.
  4093.  
  4094. Rather than working on a directory, this routine works on files
  4095. in an archive.  Supported archive formats include ARC, ARJ,
  4096. LZH, PAK, ZIP and ZOO, as well as LHARC and PKZIP (ZIP2EXE)
  4097. self-extracting archives in .COM or .EXE form.  If no extension
  4098. is given, a search will be made through each valid archive
  4099. extension, and the first matching archive will be used for the
  4100. file search.
  4101.  
  4102. Archive names may contain drive and subdirectory specs, but not
  4103. wildcards.  File names may contain wildcards, but not drive or
  4104. subdir specs.
  4105.  
  4106. When you are done searching, be sure to use CloseA to terminate
  4107. the search.
  4108.  
  4109. Routines in this series include:
  4110.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4111.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4112.  
  4113.    FindFirstA ArcName$, FileName$, ErrCode%
  4114.  
  4115. ArcName$    name of archive to search through
  4116. FileName$   name of file(s) for which to search
  4117. -------
  4118. ErrCode%    error code (0 if no error, else no matching files)
  4119.  
  4120. Name  : FindFirstF           (Find First File)
  4121. Class : Disk
  4122. Level : DOS
  4123.  
  4124. This is part of a set of routines included for compatibility
  4125. with ADVBAS and ProBas.  A better solution may be found in
  4126. FindFirstFx.
  4127.  
  4128. The FindFirstF routine is used to find the first file that
  4129. matches search parameters which you specify.  Various
  4130. information about the file that matches (if any) can be
  4131. retrieved by other routines.  See also FindNextF.
  4132.  
  4133. The file name specified may contain a drive and subdirectory
  4134. specification. Wildcards are also allowed.
  4135.  
  4136. Possible search attributes are as follows:
  4137.  
  4138.    Normal          0      (nothing special)
  4139.    Hidden          2      file is "invisible"
  4140.    System          4      special DOS system file
  4141.    Subdirectory   16      subdirectory
  4142.  
  4143. You can combine the attributes by adding them together.  All
  4144. searches will match if any of the specified attributes are
  4145. found, so if you're looking only for a specific attribute, you
  4146. will need to test the results using GetAttrF.
  4147.  
  4148. Routines in this series include:
  4149.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4150.    GetTimeF, GetSizeFL
  4151.  
  4152.    FindFirstF FileName$, FAttr%, ErrCode%
  4153.  
  4154. FileName$   name of file(s) for which to search
  4155. FAttr%      file attribute(s) to seek
  4156. -------
  4157. ErrCode%    error code (0 if no error, else no matching files)
  4158.  
  4159. Name  : FindFirstFx          (Find First File, Extended)
  4160. Class : Disk
  4161. Level : DOS
  4162.  
  4163. The FindFirstFx routine is used to find the first file that
  4164. matches search parameters which you specify.  Various
  4165. information about the file that matches (if any) can be
  4166. retrieved by other routines.
  4167.  
  4168. The file name specified may contain a drive and subdirectory
  4169. specification. Wildcards are also allowed.
  4170.  
  4171. Possible search attributes are as follows:
  4172.  
  4173.    Normal          0      (nothing special)
  4174.    Read Only       1      file can be read, but not written to
  4175.    Hidden          2      file is "invisible"
  4176.    System          4      special DOS system file
  4177.    Subdirectory   16      subdirectory
  4178.  
  4179. You can combine the attributes by adding them together.  All
  4180. searches will match if any of the specified attributes are
  4181. found, so if you're looking only for a specific attribute, you
  4182. will need to test the results using GetAttrFx.
  4183.  
  4184. Routines in this series include:
  4185.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4186.    GetTimeFx$, GetSizeFx&
  4187.  
  4188. These routines differ from the older FindFirstF-based series in
  4189. two major respects.  They include a Buffer$ parameter, which
  4190. allows you to have more than one search going on at a time.
  4191. This makes it safe to use these routines in subprograms without
  4192. conflict with the main program.  It also allows you to search
  4193. entire subdirectory trees recursively.  The other major
  4194. difference is that many of these routines are coded as
  4195. functions for greater convenience.
  4196.  
  4197.    Buffer$ = SPACE$(64)
  4198.    FindFirstFx Buffer$, FileName$, FAttr%, ErrCode%
  4199.  
  4200. FileName$   name of file(s) for which to search
  4201. FAttr%      file attribute(s) to seek
  4202. -------
  4203. Buffer$     buffer used in search (init to 64 characters)
  4204. ErrCode%    error code (0 if no error, else no matching files)
  4205.  
  4206. Name  : FindNextA            (Find Next file in an Archive)
  4207. Class : Disk
  4208. Level : DOS
  4209.  
  4210. This routine is for use after FindFirstA, to find any
  4211. additional archived files which may match your search
  4212. specifications.
  4213.  
  4214. Routines in this series include:
  4215.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4216.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4217.  
  4218.    FindNextA ErrCode%
  4219.  
  4220. -------
  4221. ErrCode%    error code (0 if no error, else no matching files)
  4222.  
  4223. Name  : FindNextF            (Find Next File)
  4224. Class : Disk
  4225. Level : DOS
  4226.  
  4227. This routine is for use after FindFirstF, to find any
  4228. additional files which may match your search specifications.
  4229.  
  4230. Routines in this series include:
  4231.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4232.    GetTimeF, GetSizeFL
  4233.  
  4234.    FindNextF ErrCode%
  4235.  
  4236. -------
  4237. ErrCode%    error code (0 if no error, else no matching files)
  4238.  
  4239. Name  : FindNextFx           (Find Next File, Extended)
  4240. Class : Disk
  4241. Level : DOS
  4242.  
  4243. This routine is for use after FindFirstFx, to find any
  4244. additional files which may match your search specifications.
  4245.  
  4246. Routines in this series include:
  4247.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4248.    GetTimeFx$, GetSizeFx&
  4249.  
  4250.    FindNextFx Buffer$, ErrCode%
  4251.  
  4252. Buffer$     buffer used in search
  4253. -------
  4254. Buffer$     updated buffer
  4255. ErrCode%    error code (0 if no error, else no matching files)
  4256.  
  4257. Name  : FindPatch            (Find Patch location)
  4258. Class : Disk
  4259. Level : DOS
  4260.  
  4261. This is one of a set of routines that allow you to write
  4262. self-modifying code. Your program can patch DATA statements in
  4263. itself or in another program, allowing you to save
  4264. configuration information (for example) without having to
  4265. create additional data files.
  4266.  
  4267. In order for this routine to work, you must have a series of
  4268. DATA statements containing quoted strings of the maximum
  4269. desired length.  The first DATA statement must contain a unique
  4270. string, as FindPatch will use it to locate the data block.
  4271. Note that if your program is patching itself, you must READ the
  4272. unique string rather than assigning it directly, to make sure
  4273. it's unique.  The string must exist at only one place in the
  4274. program.
  4275.  
  4276. See the PATCHER.BAS file if you would like clarification.  This
  4277. little demo program, when compiled, will patch itself with
  4278. whatever you enter on the command line.  For instance, if you
  4279. type PATCHER BANANA, it will store "BANANA" in its DATA
  4280. statement.  PDEMO will not work in the QuickBASIC environment,
  4281. of course.  You must compile it to an .EXE file.
  4282.  
  4283. You may compile the program using any switches.  You may not
  4284. use the /E (/EXEPACK) switch for LINK, though, as this may
  4285. alter the program DATA area.  Likewise, you must not use
  4286. compression utilities such as PKLite on the program.
  4287.  
  4288. Routines in this set include FindPatch, SetPatch, PatchDone.
  4289.  
  4290.    FindPatch FileName$, SearchSt$, ErrCode%
  4291.  
  4292. FileName$     name of the file to patch
  4293. SearchSt$     value of the first DATA statement
  4294. MoveBack%     not used
  4295. -------
  4296. ErrCode%      whether search worked (0 yes, <0 no, >0 Error)
  4297.  
  4298. Name  : FLock                (File Lock)
  4299. Class : Disk
  4300. Level : DOS
  4301.  
  4302. This routine locks any part of a file.  It will typically be
  4303. used for random-access files in circumstances where the file
  4304. needs to be accessed by multiple programs at the same time.
  4305. This routine lets you lock just the part of the file you need
  4306. to access, allowing other programs to work with other parts of
  4307. the file at the same time.  It is best to maintain the lock for
  4308. the shortest time possible, in case someone else needs the same
  4309. data.  The ideal technique is to lock the area, read what data
  4310. you need, write any changes, and unlock the area as a single
  4311. program block.
  4312.  
  4313. Note that it is IMPORTANT to unlock the locked area before the
  4314. file is closed and before your program terminates.  If the file
  4315. is not properly unlocked, it may be damaged.  See also FUnlock.
  4316.  
  4317. This routine is used for occasions where you expect multiple
  4318. accesses to a single file, under networking or multitasking
  4319. conditions.  For less demanding file sharing, it is safer to
  4320. simply lock the entire file when you open it-- see FOpen.
  4321.  
  4322.    FLock FileHandle%, StartPosn&, Bytes&, ErrCode%
  4323.  
  4324. FileHandle%    file handle
  4325. StartPosn&     starting offset (1 for first position)
  4326. Bytes&         number of bytes to lock
  4327. -------
  4328. ErrCode%       error code (0 if no error, else DOS error code)
  4329.  
  4330. Name  : FloorD#              (Floor, Double-precision)
  4331. Class : String
  4332. Level : Any
  4333.  
  4334. This function returns the largest integer less than or equal to
  4335. the number you give it.  This is most often used for rounding.
  4336.  
  4337.    Result# = FloorD#(Nr#)
  4338.  
  4339. Nr#          number to process
  4340. -------
  4341. Result#      result
  4342.  
  4343. Name  : FloorS!              (Floor, Single-precision)
  4344. Class : String
  4345. Level : Any
  4346.  
  4347. This function returns the largest integer less than or equal to
  4348. the number you give it.  This is most often used for rounding.
  4349.  
  4350.    Result! = FloorS!(Nr!)
  4351.  
  4352. Nr!          number to process
  4353. -------
  4354. Result!      result
  4355.  
  4356. Name  : Floppies             (Floppies installed)
  4357. Class : Equipment / Disk
  4358. Level : BIOS
  4359.  
  4360. The Floppies routine tells you how many floppy drives are
  4361. installed (0-4). See also Floppies2, a function version of this
  4362. routine.
  4363.  
  4364.    Floppies Drives%
  4365.  
  4366. -------
  4367. Drives%  number of floppy disk drives installed
  4368.  
  4369. Name  : Floppies2%           (Floppies installed)
  4370. Class : Equipment / Disk
  4371. Level : BIOS
  4372.  
  4373. The Floppies2 routine tells you how many floppy drives are
  4374. installed (0-4).
  4375.  
  4376.    Drives% = Floppies2%
  4377.  
  4378. -------
  4379. Drives%  number of floppy disk drives installed
  4380.  
  4381. Name  : FloppyType           (Floppy drive Type)
  4382. Class : Equipment / Disk
  4383. Level : Clone (AT)
  4384.  
  4385. This routine tells you what kinds of floppy drives are
  4386. installed, if any.  A code is returned for each drive, as
  4387. follows:
  4388.  
  4389.    0    no drive
  4390.    1    5 1/4"    360K
  4391.    2    5 1/4"    1.2M
  4392.    3    3 1/2"    720K
  4393.    4    3 1/2"    1.44M
  4394.  
  4395. Result codes of 5-7 are available, but not yet defined.  One
  4396. might guess that the 2.88M drive supported by DOS 5.0 will be
  4397. drive type 5.
  4398.  
  4399. Note that this routine supports a maximum of only two drives.
  4400. It is possible for a machine to have up to four drives, but
  4401. there is not currently any good way to find out about them.
  4402.  
  4403. FloppyType should only be used on AT-class machines.  It will
  4404. not work on PC/XT computers and may cause unusual results if
  4405. used on such machines.  It will also not work on some of the
  4406. earliest AT machines, which didn't adhere to the standard CMOS
  4407. format.
  4408.  
  4409.    FloppyType DriveA%, DriveB%
  4410.  
  4411. -------
  4412. DriveA%    drive type of first floppy drive
  4413. DriveB%    drive type of second floppy drive
  4414.  
  4415. Name  : FlushToDisk          (Flush file buffers To Disk)
  4416. Class : Disk
  4417. Level : DOS
  4418.  
  4419. This is a "file safety" routine for use with files opened by
  4420. FOpen1 or FCreate.  Files are normally buffered by DOS, which
  4421. makes file handling faster but creates the danger of losing the
  4422. file if there is a crash or power outage.  By flushing the file
  4423. to disk, you insure that it is updated to the current moment.
  4424.  
  4425. Note: this routine will need to temporarily create a new file
  4426. handle if DOS versions before 4.0 are used.
  4427.  
  4428.    FlushToDisk Handle%, ErrCode%
  4429.  
  4430. Handle%    handle of the file to flush
  4431. -------
  4432. ErrCode%   error code: 0 if none, else DOS Error
  4433.  
  4434. Name  : FOpen1               (File Open)
  4435. Class : Disk
  4436. Level : DOS
  4437.  
  4438. This routine opens an existing file for use with the PBClone
  4439. file handling routines.  If you need to create a file that
  4440. doesn't already exist, use the FCreate routine instead.
  4441.  
  4442. The file may be opened for reading, writing, or both:
  4443.  
  4444.    0   Read
  4445.    1   Write
  4446.    2   Read/Write
  4447.  
  4448. You may specify a file sharing mode for use with networks and
  4449. multitaskers. This will only take effect if the DOS version is
  4450. 3.0 or later and if the DOS SHARE utility has been executed.
  4451. Otherwise, it will be ignored.
  4452.  
  4453.    0   Normal       compatibility mode: no file sharing
  4454.    1   Exclusive    no one else may access the file
  4455.    2   Deny Write   no one else may write to the file
  4456.    3   Deny Read    no one else may read from the file
  4457.    4   Deny None    anyone else may read from or write to file
  4458.  
  4459. Most of the time, "Deny Write" will be appropriate.  This
  4460. allows others to read the file, but not to modify the file on
  4461. you unexpectedly.
  4462.  
  4463. See the discussion of predefined device handles at FClose1.
  4464.  
  4465.    FOpen1 FileName$, ReadWrite%, Sharing%, Handle%, ErrCode%
  4466.  
  4467. FileName$   name of the file to open
  4468. ReadWrite%  whether you want input, output, or both (see above)
  4469. Sharing%    file sharing mode (see above)
  4470. -------
  4471. Handle%    handle by which to access the file (if no error)
  4472. ErrCode%   error code: 0 if no error, else DOS Error
  4473.  
  4474. Name  : ForceMatch$          (Force Match of file to wildcard)
  4475. Class : Disk
  4476. Level : Any
  4477.  
  4478. The ForceMatch$ function allows you to mimic DOS commands that
  4479. operate on source file(s) and destination file(s).  It forces a
  4480. source file name to match a specified pattern (which may
  4481. contain wildcards), producing an appropriate destination file
  4482. name.
  4483.  
  4484. For example, if the source is "TESTNAME.BAS" and the pattern is
  4485. "?RUE*.*", the result would be "TRUENAME.BAS".
  4486.  
  4487. Consider the DOS command "COPY *.BAS A:*.BAK".  The "*.BAK"
  4488. part is the desired pattern.  The "*.BAS" part specifies which
  4489. files to copy to the new pattern.  Each filename that matches
  4490. "*.BAS" is translated through the "*.BAK" pattern to give the
  4491. destination filename.  The ForceMatch$ function is designed to
  4492. do this sort of translation for you.
  4493.  
  4494.    DestFile$ = ForceMatch$(Pattern$, SrcFile$)
  4495.  
  4496. Pattern$   pattern of desired file name (may contain wildcards)
  4497. SrcFile$   file name to force through the pattern
  4498. -------
  4499. DestFile$  resulting file name
  4500.  
  4501. Name  : FormatDate           (Format Date)
  4502. Class : Time
  4503. Level : Any
  4504.  
  4505. This is a highly flexible date formatting routine.  It accepts
  4506. a date in one of the usual American formats ("03-22-1990",
  4507. "03/22/90", or even "3/22/90") and converts it according to a
  4508. format string.  This format string allows you to normalize the
  4509. date, select a new delimiter, choose between two-digit and
  4510. four-digit years, and even change the order from month/day/year
  4511. to anything else.  An error code will be returned if the date
  4512. is not valid.
  4513.  
  4514. The format string can be as simple as "##/##/##", which
  4515. specifies that the usual month/day/year order be used, with a
  4516. delimiter of "/" and a two-digit year.  If you want to change
  4517. the date order, you would need a format like "DD.MM.YYYY"
  4518. instead.  For sorting or storage, you might want to convert the
  4519. date to a plain number, using a format string like "YYYYMMDD".
  4520. The result could then be converted to a LONG with the BASIC VAL
  4521. function.
  4522.  
  4523.    FormatDate DateSt$, Format$, Result$, ErrCode%
  4524.  
  4525. DateSt$     date to format (month, day, year order)
  4526. Format$     format for the date
  4527. -------
  4528. Result$     resulting date
  4529. ErrCode     whether the date is valid (0 ok)
  4530.  
  4531. Name  : FReadLn              (File Read Line)
  4532. Class : Disk
  4533. Level : DOS
  4534.  
  4535. This routine works like LINE INPUT-- it reads in an entire line
  4536. of text from a file.  The Dest$ variable must be set to the
  4537. desired maximum length beforehand.  On return, the number of
  4538. characters is returned in DLen%, and TooLong% will be set if
  4539. the Dest$ variable is full and a carriage return/linefeed pair
  4540. was not (yet?) found.
  4541.  
  4542.    Dest$ = SPACE$(MaxLength%)
  4543.    FReadLn Handle%, Dest$, DLen%, TooLong%, ErrCode%
  4544.    Dest$ = LEFT$(Dest$, DLen%)
  4545.  
  4546. Handle%    handle of the file
  4547. -------
  4548. Dest$      result (init to max length first)
  4549. DLen%      number of characters in result
  4550. TooLong%   zero if we read it all, -1 if CR/LF not found
  4551. ErrCode%   zero if no error, else DOS error code
  4552.  
  4553. Name  : FromPostal$          (From Postal Abbreviation)
  4554. Class : String
  4555. Level : Any
  4556.  
  4557. This function returns the state name corresponding to a given
  4558. two-letter postal abbreviation.  It handles all U.S. postal
  4559. abbreviations, including states (e.g., "AZ" = "Arizona") and a
  4560. number of other countries (e.g., "PR" = "Puerto Rico").  A null
  4561. string ("") is returned if the specified abbreviation is not a
  4562. valid code.
  4563.  
  4564. The conversion can also be done the other way around-- see the
  4565. ToPostal$ function.
  4566.  
  4567.    PlaceName$ = FromPostal$(Abbrev$)
  4568.  
  4569. Abbrev$      two-letter postal abbreviation
  4570. -------
  4571. PlaceName$   place name corresponding with abbreviation
  4572.  
  4573. Name  : FSetEnd              (File Set to End)
  4574. Class : Disk
  4575. Level : DOS
  4576.  
  4577. This moves the file pointer to the end of the file.  It is for
  4578. use with files opened by FOpen1 or FCreate.  The usual purpose
  4579. for this is to append information to an existing file.
  4580.  
  4581. Note that some text files may have a Control-Z or CHR$(26) on
  4582. the end.  For historical reasons, this character is sometimes
  4583. used as an "end of file" marker.  When dealing with text files,
  4584. you may want to examine the last character of the file to make
  4585. sure it isn't a Control-Z.
  4586.  
  4587. Some of Microsoft's BASIC compilers are among the programs
  4588. which, unfortunately, put a Control-Z at the end of a file (if
  4589. you OPEN for OUTPUT).
  4590.  
  4591.    FSetEnd Handle%
  4592.  
  4593. Handle%    handle of the file
  4594.  
  4595. Name  : FSetLoc              (File Set Location to byte)
  4596. Class : Disk
  4597. Level : DOS
  4598.  
  4599. This moves the file pointer to a specified position in the
  4600. file.  It is for use with files opened by FOpen1 or FCreate.
  4601. File positions are considered to start at 1.
  4602.  
  4603.    FSetLoc Handle%, Posn&
  4604.  
  4605. Handle%    handle of the file
  4606. Posn&      location to which to move
  4607.  
  4608. Name  : FSetOfs              (File Set location by Offset)
  4609. Class : Disk
  4610. Level : DOS
  4611.  
  4612. This moves the file pointer backwards or forwards in the file.
  4613. It is for use with files opened by FOpen1 or FCreate.
  4614.  
  4615.    FSetOfs Handle%, Offset&
  4616.  
  4617. Handle%    handle of the file
  4618. Offset&    number of bytes by which to move
  4619.  
  4620. Name  : FSetRec              (File Set location to Record)
  4621. Class : Disk
  4622. Level : DOS
  4623.  
  4624. This sets the file pointer to a specific record in the file.
  4625. It is for use with files opened by FOpen1 or FCreate.
  4626.  
  4627. This routine provides the same function as FSetLoc, but is a
  4628. bit more convenient for dealing with files composed of
  4629. fixed-length records.
  4630.  
  4631.    FSetRec Handle%, RecSize%, RecNr%
  4632.  
  4633. Handle%    handle of the file
  4634. RecSize%   number of bytes per record
  4635. RecNr%     number of record (starting at 1)
  4636.  
  4637. Name  : FSetSize             (File Set Size)
  4638. Class : Disk
  4639. Level : DOS
  4640.  
  4641. Many people have asked how to delete information from a file.
  4642. Well, there's no straightforward way to do it most of the time,
  4643. but if the record is at the end of the file, you can chop it
  4644. right off.
  4645.  
  4646. This routine can also be used to make a file larger, perhaps
  4647. pre-allocating space that will be used later (for better speed).
  4648.  
  4649. The file in question must have been opened by FCreate or FOpen1.
  4650.  
  4651.    FSetSize Handle%, Bytes&
  4652.  
  4653. Handle%    handle of the file
  4654. Bytes&     desired file size, in bytes
  4655.  
  4656. Name  : FSize                (File get Size)
  4657. Class : Disk
  4658. Level : DOS
  4659.  
  4660. This routine allows you to get the size of a file that was
  4661. opened by FOpen1 or FCreate.
  4662.  
  4663. See also FSize2, the FUNCTION version of this routine.
  4664.  
  4665.    FSize Handle%, Bytes&
  4666.  
  4667. Handle%    handle of the file
  4668. -------
  4669. Bytes&     file size, in bytes
  4670.  
  4671. Name  : FSize2&              (File get Size)
  4672. Class : Disk
  4673. Level : DOS
  4674.  
  4675. This routine allows you to get the size of a file that was
  4676. opened by FOpen1 or FCreate.
  4677.  
  4678. See also FSize, the Sub version of this routine.
  4679.  
  4680.    Bytes& = FSize2&(Handle%)
  4681.  
  4682. Handle%    handle of the file
  4683. -------
  4684. Bytes&     file size, in bytes
  4685.  
  4686. Name  : FUnlock              (File Unlock)
  4687. Class : Disk
  4688. Level : DOS
  4689.  
  4690. This routine unlocks any part of a file.  It is used to undo
  4691. the effects of FLock, which locks any part of a file.  It is
  4692. important to pass the exact same parameters to FUnlock as you
  4693. did to FLock.  See also FLock.
  4694.  
  4695. Note that it is IMPORTANT to unlock the locked area before the
  4696. file is closed and before your program terminates.  If the file
  4697. is not properly unlocked, it may be damaged.
  4698.  
  4699.    FUnlock FileHandle%, StartPosn&, Bytes&, ErrCode%
  4700.  
  4701. FileHandle%    file handle
  4702. StartPosn&     starting offset (1 for first position)
  4703. Bytes&         number of bytes to unlock
  4704. -------
  4705. ErrCode%       error code (0 if no error, else DOS error code)
  4706.  
  4707. Name  : Get4DOSv             (Get 4DOS Version)
  4708. Class : Equipment
  4709. Level : DOS
  4710.  
  4711. The Get4DOSv routine returns the version of 4DOS being used.
  4712. It returns the results as two integers containing the major and
  4713. minor version numbers. For instance, 4DOS 4.0 would return a
  4714. major number of 4, minor 0.  If 4DOS is not installed, both
  4715. version numbers will be zero.
  4716.  
  4717. If you're not familiar with 4DOS, it's a terrific improved
  4718. replacement for COMMAND.COM.  For more information, write JP
  4719. Software Inc., P.O. Box 1470, Arlington MA 02174, or call your
  4720. local BBS.
  4721.  
  4722.    Get4DOSv MajorV%, MinorV%
  4723.  
  4724. -------
  4725. MajorV%   major part of the 4DOS version
  4726. MinorV%   minor part of the 4DOS version
  4727.  
  4728. Name  : GetAttrF             (Get Attribute of File)
  4729. Class : Disk
  4730. Level : DOS
  4731.  
  4732. The GetAttrF routine returns the attributes of a file matched
  4733. by FindFirstF or FindNextF.
  4734.  
  4735.    Normal          0      (nothing special)
  4736.    Read Only       1      file can be read, but not written to
  4737.    Hidden          2      file is "invisible"
  4738.    System          4      special DOS system file
  4739.    Subdirectory   16      subdirectory
  4740.    Archive        32      (used by some backup utilities)
  4741.  
  4742. You can see if a certain value is set using the AND operator:
  4743.  
  4744.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4745.  
  4746. Since the values are all powers of two, the AND operator makes
  4747. for a convenient way of decoding the results.
  4748.  
  4749. See also the ExplainFAttr$ function, which decodes the meanings
  4750. of the attribute for you.
  4751.  
  4752. Routines in this series include:
  4753.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4754.    GetTimeF, GetSizeFL
  4755.  
  4756.    GetAttrF FAttr%
  4757.  
  4758. -------
  4759. FAttr%   attributes that are set
  4760.  
  4761. Name  : GetAttrFx%           (Get Attribute of File, Extended)
  4762. Class : Disk
  4763. Level : DOS
  4764.  
  4765. The GetAttrFx% function returns the attributes of a file
  4766. matched by FindFirstFx or FindNextFx.
  4767.  
  4768.    Normal          0      (nothing special)
  4769.    Read Only       1      file can be read, but not written to
  4770.    Hidden          2      file is "invisible"
  4771.    System          4      special DOS system file
  4772.    Subdirectory   16      subdirectory
  4773.    Archive        32      (used by some backup utilities)
  4774.  
  4775. You can see if a certain value is set using the AND operator:
  4776.  
  4777.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4778.  
  4779. Since the values are all powers of two, the AND operator makes
  4780. for a convenient way of decoding the results.
  4781.  
  4782. See also the ExplainFAttr$ function, which decodes the meanings
  4783. of the attribute for you.
  4784.  
  4785. Routines in this series include:
  4786.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4787.    GetTimeFx$, GetSizeFx&
  4788.  
  4789.    FAttr% = GetAttrFx%(Buffer$)
  4790.  
  4791. Buffer$   buffer used in search
  4792. -------
  4793. FAttr%    file attributes
  4794.  
  4795. Name  : GetColor             (Get Color)
  4796. Class : Display
  4797. Level : Clone
  4798.  
  4799. This routine tells you the current default foreground and
  4800. background colors being used by BASIC.  It should be used only
  4801. in text modes.
  4802.  
  4803.    GetColor Foreground%, Background%
  4804.  
  4805. -------
  4806. Foreground%   foreground color
  4807. Background%   background color
  4808.  
  4809. Name  : GetCommAddr          (Get Comm Address)
  4810. Class : Serial
  4811. Level : Clone
  4812.  
  4813. This routine allows you to determine the base port address of a
  4814. serial port. You tell it the COM port number (1-4) and it
  4815. returns the port address.  If there is no port installed, zero
  4816. will be returned.
  4817.  
  4818. Note that ports are "supposed" to be assigned sequentially-- in
  4819. other words, if you find a "zero" port address, there will be
  4820. no ports after that.  This is not necessarily the case,
  4821. however.  Some semi-standard machines may have a COM2 without a
  4822. COM1, for instance.  QuickBASIC gets confused in that case, but
  4823. it's no problem with my PBClone or BasWiz libraries.
  4824.  
  4825. Aside from purely informational purposes, this routine can be
  4826. useful in conjunction with SetCommAddr in manipulating the
  4827. serial ports.
  4828.  
  4829.    GetCommAddr PortNr%, PortAddr%
  4830.  
  4831. PortNr%     COM port number (1-4)
  4832. -------
  4833. PortAddr%   port address
  4834.  
  4835. Name  : GetCRCA              (Get CRC of Archive file)
  4836. Class : Disk / Time
  4837. Level : DOS
  4838.  
  4839. GetCRCA returns the 16-bit CRC of an archived file matched by
  4840. the FindFirstA or FindNextA routines.  Since some archives use
  4841. 32-bit CRCs, you may wish to use the more generic version of
  4842. this routine, GetCRCAL.
  4843.  
  4844. Routines in this series include:
  4845.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4846.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4847.  
  4848.    GetCRCA CRC16%
  4849.  
  4850. -------
  4851. CRC16%     16-bit CRC
  4852.  
  4853. Name  : GetCRCAL             (Get CRC of Archive file as Long)
  4854. Class : Disk / Time
  4855. Level : DOS
  4856.  
  4857. GetCRCAL returns the 32-bit CRC of an archived file matched by
  4858. the FindFirstA or FindNextA routines.  If the archive only has
  4859. a 16-bit CRC, the result is converted to 32 bits, so this
  4860. routine works with all archives.
  4861.  
  4862. Routines in this series include:
  4863.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4864.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4865.  
  4866.    GetCRCAL CRC32%
  4867.  
  4868. -------
  4869. CRC32%     32-bit CRC
  4870.  
  4871. Name  : GetCRT               (Get CRT)
  4872. Class : Display / Equipment
  4873. Level : Clone
  4874.  
  4875. The GetCRT routine simply tells you whether the current display
  4876. is capable of handling colors or not.  An unsophisticated
  4877. routine, GetCRT assumes that if the display is an MDA/Hercules,
  4878. it can't do color, but otherwise it can.
  4879.  
  4880. See also GetEGA, GetHGA and GetVGA.
  4881.  
  4882.    GetCRT Colour%
  4883.  
  4884. -------
  4885. Colour%   whether the display is color (0 if no)
  4886.  
  4887. Name  : GetCRT2%             (Get CRT)
  4888. Class : Display / Equipment
  4889. Level : Clone
  4890.  
  4891. The GetCRT2 routine simply tells you whether the current
  4892. display is capable of handling colors or not.  An
  4893. unsophisticated routine, GetCRT2 assumes that if the display is
  4894. an MDA/Hercules, it can't do color, but otherwise it can.
  4895.  
  4896. See also GetEGA, GetHGA and GetVGA.
  4897.  
  4898.    Colour% = GetCRT%
  4899.  
  4900. -------
  4901. Colour%   whether the display is color (0 if no)
  4902.  
  4903. Name  : GetDateA             (Get Date of Archive file)
  4904. Class : Disk / Time
  4905. Level : DOS
  4906.  
  4907. GetDateA returns the date of a archived file matched by the
  4908. FindFirstA or FindNextA routines.
  4909.  
  4910. Routines in this series include:
  4911.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4912.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4913.  
  4914.    GetDateA MonthNr%, DayNr%, YearNr%
  4915.  
  4916. -------
  4917. MonthNr%    month
  4918. DayNr%      day
  4919. YearNr%     year
  4920.  
  4921. Name  : GetDateAT            (Get Date from AT clock)
  4922. Class : Time
  4923. Level : BIOS (AT)
  4924.  
  4925. This routine gets the date from the hardware real-time clock in
  4926. AT-class computers.  Depending on the DOS version, this date
  4927. may be partially or completely independent of the date kept by
  4928. DOS in software.  DOS always reads the date from the hardware
  4929. clock when it starts up.  However, use of the DATE command in
  4930. DOS (and the DATE$ function in QuickBASIC) may relate only to
  4931. the software copy of the date, which is not always guaranteed
  4932. to be the same as the date in the hardware clock due to certain
  4933. discrepancies in DOS.
  4934.  
  4935.    GetDateAT MonthNr%, DayNr%, YearNr%, ErrCode%
  4936.  
  4937. -------
  4938. MonthNr%     month number (1-12)
  4939. DayNr%       day (1-31)
  4940. YearNr%      year (1980-2079)
  4941. ErrCode%     error code: 0 if no error, else clock has stopped
  4942.  
  4943. Name  : GetDateF             (Get Date of File)
  4944. Class : Disk / Time
  4945. Level : DOS
  4946.  
  4947. The GetDateF routine returns the date of a file matched by
  4948. FindFirstF or FindNextF.
  4949.  
  4950. Routines in this series include:
  4951.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4952.    GetTimeF, GetSizeFL
  4953.  
  4954.    GetDateF MonthNr%, DayNr%, YearNr%
  4955.  
  4956. -------
  4957. MonthNr%    month
  4958. DayNr%      day
  4959. YearNr%     year
  4960.  
  4961. Name  : GetDateFx$           (Get Date of File, Extended)
  4962. Class : Disk / Time
  4963. Level : DOS
  4964.  
  4965. The GetDateFx$ function returns the date of a file matched by
  4966. FindFirstFx or FindNextFx.
  4967.  
  4968. Routines in this series include:
  4969.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4970.    GetTimeFx$, GetSizeFx&
  4971.  
  4972.    FileDate$ = GetDateFx$(Buffer$)
  4973.  
  4974. Buffer$     buffer used in search
  4975. -------
  4976. FileDate$   date of file (e.g., "02-28-1991")
  4977.  
  4978. Name  : GetDOSv              (Get DOS Version)
  4979. Class : Equipment
  4980. Level : DOS
  4981.  
  4982. The GetDOSv routine tells you what version of DOS you're
  4983. using.  It returns the results as two integers containing the
  4984. major and minor version numbers. For instance, MS-DOS 2.11
  4985. would return a major number of 2, minor 11.
  4986.  
  4987. The OS/2 compatibility box returns version numbers beginning at
  4988. 10.00.  For instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0
  4989. returns 20.00.
  4990.  
  4991.    GetDOSv MajorV%, MinorV%
  4992.  
  4993. -------
  4994. MajorV%   major part of the DOS version
  4995. MinorV%   minor part of the DOS version
  4996.  
  4997. Name  : GetDrive$            (Get default Drive)
  4998. Class : Disk
  4999. Level : DOS
  5000.  
  5001. This routine tells you the letter of the current default drive.
  5002.  
  5003. See also GetDrv, the SUB version of this routine.
  5004.  
  5005.    Drive$ = GetDrive$
  5006.  
  5007. -------
  5008. Drive$    default drive letter.
  5009.  
  5010. Name  : GetDrv               (Get default Drive)
  5011. Class : Disk
  5012. Level : DOS
  5013.  
  5014. This routine tells you the letter of the current default drive.
  5015.  
  5016. See also GetDrive, the FUNCTION version of this routine.
  5017.  
  5018.    Drive$ = "x"
  5019.    GetDrv Drive$
  5020.  
  5021. -------
  5022. Drive$    default drive letter.  Init to at least one character.
  5023.  
  5024. Name  : GetDView             (Get DESQview version)
  5025. Class : Miscellaneous
  5026. Level : DOS
  5027.  
  5028. The GetDView routine tells you what version of DESQview is
  5029. loaded.  It returns the results as two integers containing the
  5030. major and minor version numbers.  For instance, DESQview 2.0
  5031. would return a major number of 2 and a minor number of 0.  If
  5032. DESQview is not loaded, zeroes are returned.
  5033.  
  5034. See also GetTView, GetTVScreen, UpdTVScreen.
  5035.  
  5036.    GetDView MajorV%, MinorV%
  5037.  
  5038. -------
  5039. MajorV%   major part of the DESQview version (0 if no DESQview)
  5040. MinorV%   minor part of the DESQview version
  5041.  
  5042. Name  : GetEGA               (Get EGA information)
  5043. Class : Display / Equipment
  5044. Level : BIOS
  5045.  
  5046. This routine tells you whether an EGA (or VGA) is available,
  5047. and if so, what kind.  It tells you whether the attached
  5048. display is monochrome or color, and how many kilobytes of RAM
  5049. are installed in the adapter.
  5050.  
  5051. Many early EGAs had only 64K of RAM.  Current adapters have
  5052. 256K or more. Since there are some limitations attached to
  5053. having only 64K, it's a good idea to see if this is the case--
  5054. most PBClone EGA routines won't work properly on 64k adapters.
  5055.  
  5056. See also GetCRT, GetHGA and GetVGA.
  5057.  
  5058. See also GetEGA2, the FUNCTION version of this routine.
  5059.  
  5060.    GetEGA Display%, KBytes%
  5061.  
  5062. -------
  5063. Display%  EGA display type: 0 no EGA, 1 EGA color, 2 EGA mono
  5064. KBytes%   kilobytes of display memory
  5065.  
  5066. Name  : GetEGA2%             (Get EGA information)
  5067. Class : Display / Equipment
  5068. Level : BIOS
  5069.  
  5070. This routine tells you whether an EGA (or VGA) is available.
  5071.  
  5072. See also GetCRT2, GetHGA and GetVGA2.
  5073.  
  5074. See also GetEGA, the SUB version of this routine.  It returns
  5075. additional information.
  5076.  
  5077.    IsEGA% = GetEGA2%
  5078.  
  5079. -------
  5080. IsEGA%    whether the display is an EGA (0 if no)
  5081.  
  5082. Name  : GetError             (Get Error code from DOS)
  5083. Class : Miscellaneous
  5084. Level : Clone
  5085.  
  5086. NOTE: The GetError2% function should be used in preference to
  5087. this routine.
  5088.  
  5089. The GetError routine is used in conjunction with CatchError.
  5090. It lets you get the exit code (error level) returned by a
  5091. program to which you have SHELLed. Since CatchError hooks an
  5092. interrupt to do its work, you must always make sure to use
  5093. GetError afterwards to "clean up".  See also CatchError.
  5094.  
  5095. Note that differences in DOS mean that this routine will not
  5096. always work.  In some versions of DOS, you can only get the
  5097. error level if a batch file was executed; in others, you can't
  5098. get the error level from a batch file at all. Sorry about
  5099. that.  I don't know of any way to work around it.
  5100.  
  5101.    CatchError
  5102.    SHELL ProgramName$
  5103.    GetError ExitCode%
  5104.  
  5105. -------
  5106. ExitCode%   exit code returned by SHELLed-to program (0-255)
  5107.  
  5108. Name  : GetError2%           (Get Error code from DOS)
  5109. Class : Miscellaneous
  5110. Level : DOS
  5111.  
  5112. The GetError2% function gets the exit code (error level)
  5113. returned by a program to which you have SHELLed.  It should be
  5114. used as soon as possible after the SHELL, and its value will
  5115. only be meaningful on the first call after the SHELL.
  5116.  
  5117. This routine should be used in preference to CatchError and
  5118. GetError.
  5119.  
  5120.    SHELL ProgramName$
  5121.    ExitCode% = GetError2%
  5122.  
  5123. -------
  5124. ExitCode%   exit code returned by SHELLed-to program (0-255)
  5125.  
  5126. Name  : GetExecPath          (Get Execution Path of program)
  5127. Class : Disk
  5128. Level : DOS 3.0+
  5129.  
  5130. This routine returns the full path of your program, i.e., the
  5131. drive, subdirectory, and name of the program.  It does not rely
  5132. on the current drive and subdirectory settings or look at the
  5133. PATH setting-- DOS tells it directly.  This makes it an
  5134. excellent way to find the program's "home" directory, where
  5135. (hopefully) any data files associated with the program will
  5136. also be stored.
  5137.  
  5138.    SelfName$ = SPACE$(80)
  5139.    GetExecPath SelfName$, SelfLen%
  5140.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  5141.  
  5142. -------
  5143. SelfName$   full path for current program.  Init to 80+ chars.
  5144. SelfLen%    length of the full path spec.
  5145.  
  5146. Name  : GetExtM              (Get Extended Memory)
  5147. Class : Memory / Equipment
  5148. Level : BIOS (AT)
  5149.  
  5150. This routine allows you to find out how much extended memory is
  5151. available. It should only be used on AT-class computers, since
  5152. older PCs do not support extended memory.  Note that some of
  5153. the very early AT machines will return erroneous results.
  5154.  
  5155. The amount of memory returned may be either the total amount of
  5156. extended memory installed or just the amount available at this
  5157. time, depending on how previously-installed programs (if any)
  5158. make use of extended memory. Unfortunately, there is no
  5159. standard which defines how a program should use extended memory
  5160. as there is with EMS (expanded memory), so there is no way for
  5161. a program to determine whether or how another program is using
  5162. extended memory.  Microsoft is trying to clear up this
  5163. situation with its HIMEM driver (available at your local BBS,
  5164. or [last I looked] free from Microsoft), but this approach
  5165. hasn't really become standard yet.
  5166.  
  5167.    GetExtM KBytes%
  5168.  
  5169. -------
  5170. KBytes%    the number of kilobytes of extended memory
  5171.  
  5172. Name  : GetFAttr             (Get File Attribute)
  5173. Class : Disk
  5174. Level : DOS
  5175.  
  5176. This routine lets you read the attributes of a file or
  5177. subdirectory.  The attributes may contain a combination of any
  5178. of the following:
  5179.  
  5180.    Normal          0      (nothing special)
  5181.    Read Only       1      file can be read, but not written to
  5182.    Hidden          2      file is "invisible"
  5183.    System          4      special DOS system file
  5184.    Subdirectory   16      subdirectory
  5185.    Archive        32      (used by some backup utilities)
  5186.  
  5187. You can see if a certain value is set by using the AND operator:
  5188.  
  5189.    IF FAttr% AND 2 THEN PRINT "Hidden file"
  5190.  
  5191. Since the values are all powers of two, the AND operator makes
  5192. for a convenient way of decoding the results.
  5193.  
  5194. See also the ExplainFAttr$ function, which decodes the meanings
  5195. of the attribute for you.
  5196.  
  5197.    GetFAttr FileName$, FAttr%
  5198.  
  5199. FileName$   name of the file (or subdirectory) to examine
  5200. -------
  5201. FAttr%      attributes that are set
  5202.  
  5203. Name  : GetFDate             (Get File Date)
  5204. Class : Disk / Time
  5205. Level : DOS
  5206.  
  5207. This routine gets the date of a file.
  5208.  
  5209.    GetFDate FileName$, MonthNr%, DayNr%, YearNr%
  5210.  
  5211. FileName$   name of the file to examine
  5212. -------
  5213. MonthNr%    month
  5214. DayNr%      day
  5215. YearNr%     year
  5216.  
  5217. Name  : GetFSize             (Get File Size)
  5218. Class : Disk
  5219. Level : DOS
  5220.  
  5221. This function gets the size of a file.
  5222.  
  5223.    FileSize& = GetFSize&(FileName$)
  5224.  
  5225. FileName$   name of the file to examine
  5226. -------
  5227. FileSize&   size of the file, in bytes
  5228.  
  5229. Name  : GetFTime             (Get File Time)
  5230. Class : Disk / Time
  5231. Level : DOS
  5232.  
  5233. This routine gets the time of a file.
  5234.  
  5235.    GetFTime FileName$, HourNr%, MinuteNr%, SecondNr%
  5236.  
  5237. FileName$     name of the file to examine
  5238. -------
  5239. HourNr%       hour
  5240. MinuteNr%     minute
  5241. SecondNr%     second (always even, due to DOS storage techniques)
  5242.  
  5243. Name  : GetHGA%              (Get Hercules Adapter info)
  5244. Class : Display / Equipment
  5245. Level : Clone
  5246.  
  5247. This routine tells you whether a Hercules-compatible monochrome
  5248. graphics adapter is in use.
  5249.  
  5250. See also GetCRT2, GetEGA and GetVGA2.
  5251.  
  5252.    IsHGA% = GetHGA%
  5253.  
  5254. -------
  5255. IsHGA%    whether the display is Hercules mono graphics (0 no)
  5256.  
  5257. Name  : GetKbd               (Get Keyboard toggles)
  5258. Class : Input
  5259. Level : Clone
  5260.  
  5261. The GetKbd routine allows you to get the state of the four
  5262. keyboard toggles: Insert, Caps lock, Num lock, and Scroll Lock.
  5263.  
  5264.    GetKbd Insert%, Caps%, Num%, Scrl%
  5265.  
  5266. -------
  5267. Insert%    whether "insert" mode is on (0 if no)
  5268. Caps%      whether "caps lock" is on (0 if no)
  5269. Num%       whether "num lock" is on (0 if no)
  5270. Scrl%      whether "scroll lock" is on (0 if no)
  5271.  
  5272. Name  : GetKbd1              (Get Keyboard Shifts)
  5273. Class : Input
  5274. Level : Clone
  5275.  
  5276. The GetKbd1 routine allows you to get the state of the four
  5277. keyboard shift keys: Left shift, Right shift, Control and Alt.
  5278.  
  5279.    GetKbd1 LShift%, RShift%, Control%, Alt%
  5280.  
  5281. -------
  5282. LShift%    whether the left shift key is depressed (0 if no)
  5283. RShift%    whether the right shift key is depressed (0 if no)
  5284. Control%   whether a control key is depressed (0 if no)
  5285. Alt%       whether an alt key is depressed (0 if no)
  5286.  
  5287. Name  : GetKbd2              (Get Keyboard Shifts)
  5288. Class : Input
  5289. Level : AT BIOS
  5290.  
  5291. The GetKbd2 routine allows you to get the state of the six
  5292. keyboard shift keys on an "enhanced" keyboard: Left shift,
  5293. Right shift, Left Control, Right Control, Left Alt and Right
  5294. Alt.
  5295.  
  5296. Normally, the BIOS only lets you see one key at a time, which
  5297. can be a barrier when you need more input.  This is a
  5298. particular problem with action games and other real-time
  5299. applications which have complex input requirements. Due to the
  5300. special way the BIOS treats shift keys, GetKbd2 can tell if the
  5301. the various shift keys are pressed simultaneously, allowing
  5302. more flexibility.
  5303.  
  5304.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  5305.  
  5306. -------
  5307. LShift%    whether the left shift key is depressed (0 if no)
  5308. RShift%    whether the right shift key is depressed (0 if no)
  5309. LCtrl%     whether the left control key is depressed (0 if no)
  5310. RCtrl%     whether the right control key is depressed (0 if no)
  5311. LAlt%      whether the left alt key is depressed (0 if no)
  5312. RAlt%      whether the right alt key is depressed (0 if no)
  5313.  
  5314. Name  : GetKey               (Get Key or mouse)
  5315. Class : Input, Mouse
  5316. Level : BIOS
  5317.  
  5318. This routine is kind of an extended version of INPUT$.  It
  5319. waits until a key is available at the keyboard and returns the
  5320. key pressed.  At your option, it can also return if a mouse
  5321. button is pressed.
  5322.  
  5323.    GetKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  5324.  
  5325. Mouse%        whether to check the mouse (0: no)
  5326. -------
  5327. ASCIIcode%    ASCII code of the key pressed
  5328. ScanCode%     scan code of the key pressed (0 if none)
  5329. LButton%   whether the left  mouse button was pressed
  5330. RButton%  whether the right mouse button was pressed
  5331.  
  5332. Name  : GetKey3              (Get Key or 3-button mouse)
  5333. Class : Input, Mouse
  5334. Level : BIOS
  5335.  
  5336. This routine is kind of an extended version of INPUT$.  It
  5337. waits until a key is available at the keyboard and returns the
  5338. key pressed.  At your option, it can also return if a mouse
  5339. button is pressed.
  5340.  
  5341.    GetKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  5342.       MButton%, RButton%
  5343.  
  5344. Mouse%        whether to check the mouse (0: no)
  5345. -------
  5346. ASCIIcode%    ASCII code of the key pressed
  5347. ScanCode%     scan code of the key pressed (0 if none)
  5348. LButton%      whether the left   mouse button is pressed
  5349. MButton%      whether the middle mouse button is pressed
  5350. RButton%      whether the right  mouse button is pressed
  5351.  
  5352. Name  : GetLabel             (Get disk volume Label)
  5353. Class : Disk
  5354. Level : DOS
  5355.  
  5356. This routine gets the volume label from a specified drive.  See
  5357. also GetLabel2$.
  5358.  
  5359.    Label$ = SPACE$(11)
  5360.    GetLabel Drive$, Label$, LabelLen%, ErrCode%
  5361.    Label$ = LEFT$(Label$, LabelLen%)
  5362.  
  5363. Drive$     letter of the drive to examine
  5364. -------
  5365. Label$     volume label of drive.  Init to >= 11 chars.
  5366. LabelLen%  length of the volume label
  5367. ErrCode%   error code: 0 if no error, else DOS Error
  5368.  
  5369. Name  : GetLabel2$           (Get disk volume Label)
  5370. Class : Disk
  5371. Level : DOS
  5372.  
  5373. This routine gets the volume label from a specified drive.  See
  5374. also GetLabel, a subprogram version of this routine.  The
  5375. GetLabel subprogram is preferable in that it returns an error
  5376. code, but you may find the function version more convenient if
  5377. error checking is not desired.
  5378.  
  5379.    Label$ = GetLabel2$(Drive$)
  5380.  
  5381. Drive$     letter of the drive to examine
  5382. -------
  5383. Label$     volume label of the specified drive.
  5384.  
  5385. Name  : GetLIMHandles        (Get L/I/M expanded mem Handles)
  5386. Class : Memory
  5387. Level : DOS
  5388.  
  5389. Early Lotus/Intel/Microsoft expanded memory revisions provided
  5390. a limited number of "handles" which could be used to access
  5391. expanded memory-- often as few as 15 or so.  If your program
  5392. uses expanded memory and the EMS driver is one of the older
  5393. versions, you may want to make sure that enough handles are
  5394. available.  This routine tells you how many handles are in use.
  5395.  
  5396. Note that this routine expects an EMS driver to be installed.
  5397. If you can't be sure of that, use GetLIMM first to avoid an
  5398. unpleasant surprise.
  5399.  
  5400.    GetLIMHandles Handles%
  5401.  
  5402. -------
  5403. Handles%  number of EMS handles in use
  5404.  
  5405. Name  : GetLIMM              (Get L/I/M expanded Memory)
  5406. Class : Memory / Equipment
  5407. Level : DOS
  5408.  
  5409. This routine tells you how much expanded memory is installed.
  5410. If there is none, or if the EMS driver hasn't been installed,
  5411. it returns zeroes.  You should use this routine before any
  5412. other of the PBClone routines that access expanded memory,
  5413. since the other routines expect EMS to be available.
  5414.  
  5415. The results are returned in terms of EMS pages.  Each page is
  5416. 16 kilobytes.
  5417.  
  5418.    GetLIMM TotalPages%, FreePages%
  5419.  
  5420. -------
  5421. TotalPages%  number of EMS pages installed
  5422. FreePages%   number of EMS pages available for use
  5423.  
  5424. Name  : GetLIMV              (Get L/I/M expanded mem Version)
  5425. Class : Memory / Equipment
  5426. Level : DOS
  5427.  
  5428. The GetLIMV routine tells you the version of EMS driver that is
  5429. being used. The version number is separated into major and
  5430. minor parts.  For example, an EMS 3.1 driver would return a
  5431. major number of 3 and minor number of 1.
  5432.  
  5433. Note that this routine expects an EMS driver to be installed.
  5434. If you can't be sure of that, use GetLIMM first to avoid an
  5435. unpleasant surprise.
  5436.  
  5437.    GetLIMV MajorVer%, MinorVer%
  5438.  
  5439. -------
  5440. MajorVer%  major part of the EMS version number
  5441. MinorVer%  minor part of the EMS version number
  5442.  
  5443. Name  : GetLine              (Get Line of text)
  5444. Class : Display
  5445. Level : Any
  5446.  
  5447. This routine retrieves a row of text from a saved (or virtual)
  5448. screen.
  5449.  
  5450. You can use GetLine with a saved screen of any size.  The St$
  5451. parameter must be initialized to the width of the saved screen
  5452. (in columns).
  5453.  
  5454. See also ReadScreen, which allows you to read a string of any
  5455. length directly from the display.
  5456.  
  5457.    St$ = SPACE$(ScrWidth%)   ' init to v. screen width
  5458.    GetLine DSeg%, DOfs%, Row%, St$, SLen%
  5459.    St$ = LEFT$(St$, SLen%)
  5460.  
  5461. DSeg%      segment of saved screen
  5462. DOfs%      offset of saved screen
  5463. Row%       row of saved screen (starting at 1)
  5464. -------
  5465. St$        text at given row (init to width of saved screen)
  5466. SLen       logical length of text
  5467.  
  5468. Name  : GetMemBox            (Get Memory Box info)
  5469. Class : Memory
  5470. Level : DOS
  5471.  
  5472. The PBClone library comes with a TSR called MEMBOX.COM.  This
  5473. TSR reserves an area of memory which can be used as a transfer
  5474. area for communication between multiple programs-- the data
  5475. remains as long as the TSR is installed.
  5476.  
  5477. The GetMemBox routine tells you whether MEMBOX is installed,
  5478. how much memory it has, and the location of that memory.  You
  5479. can access the MEMBOX memory using any PBClone routine that
  5480. accepts segment and offset pointers.  The DGetSt and DPutSt
  5481. routines will probably be most helpful for general use.
  5482.  
  5483. NOTE that MEMBOX expects to be the last TSR installed.  If any
  5484. other TSR or program alters the INT 2Fh interrupt vector while
  5485. MEMBOX is active, the results are liable to be messy at best.
  5486.  
  5487.    GetMemLoc DSeg%, DOfs%, Bytes%
  5488.  
  5489. -------
  5490. DSeg%      memory segment
  5491. DOfs%      memory offset
  5492. Bytes%     bytes available (0 if MEMBOX is not installed)
  5493.  
  5494. Name  : GetMouseLoc          (Get Mouse Location)
  5495. Class : Mouse
  5496. Level : BIOS
  5497.  
  5498. This routine allows you to get the current location of the
  5499. mouse cursor.  It doesn't matter if the cursor is visible or
  5500. invisible.  GetMouseLoc is only for use in text mode.
  5501.  
  5502. This routine will not work properly if there is no mouse
  5503. available.  Use the MMCheck routine if you are not sure.
  5504.  
  5505. See also MMGetLoc, which returns the coordinates for graphics
  5506. mode.
  5507.  
  5508.    GetMouseLoc Row%, Column%
  5509.  
  5510. -------
  5511. Row%       mouse cursor row
  5512. Column%    mouse cursor column
  5513.  
  5514. Name  : GetMouseVer          (Get Mouse driver Version)
  5515. Class : Mouse
  5516. Level : BIOS
  5517.  
  5518. This routine retrieves various information about the mouse,
  5519. including the driver version number, mouse type, and IRQ used
  5520. by the mouse.
  5521.  
  5522. Note that this is among the mouse routines that makes you
  5523. wonder what Microsoft was thinking when they designed the mouse
  5524. driver.  The mouse driver has no provision for error codes and
  5525. the "get version" function was added comparatively recently, so
  5526. there is no way of knowing with certainty whether this routine
  5527. worked or what the mouse driver version is.  If that could be a
  5528. problem, you can reduce the risk by checking the returned
  5529. values to make sure they appear reasonable.
  5530.  
  5531. This routine will not work properly if there is no mouse
  5532. available.  Use the MMCheck routine if you are not sure.
  5533.  
  5534. The mouse type may be any of the following:
  5535.    1   bus mouse
  5536.    2   serial mouse
  5537.    3   InPort mouse
  5538.    4   PS/2 mouse
  5539.    5   Hewlett-Packard mouse
  5540.  
  5541. The IRQ will be 0 on the PS/2.  Otherwise, it will be 2-5 or 7
  5542. on Microsoft mice.  A mouse designed to take advantage of the
  5543. AT interrupt controller may use higher IRQs (to perhaps 15, I'm
  5544. not sure), so be generous if you do range checking here.
  5545.  
  5546. The version number is divided into two parts.  For instance,
  5547. mouse driver 8.20 would return a major version number of 8 and
  5548. a minor version number of 20.
  5549.  
  5550.    GetMouseVer MajorV%, MinorV%, MType%, IRQ%
  5551.  
  5552. -------
  5553. MajorV%    mouse driver major version number
  5554. MinorV%    mouse driver minor version number
  5555. MType%     mouse type
  5556. IRQ%       IRQ used by mouse
  5557.  
  5558. Name  : GetNameA             (Get Name of file in Archive)
  5559. Class : Disk
  5560. Level : DOS
  5561.  
  5562. GetNameA returns the name of an archived file matched by the
  5563. FindFirstA or FindNextA routines.  Since some archives may
  5564. include subdirectory specs along with the file name, it is
  5565. recommended that you initialize the return string to 80
  5566. characters (at least 12 are required).
  5567.  
  5568. When parsing filenames which may contain subdirectory specs,
  5569. keep in mind that the forward slash "/" may be used instead of
  5570. the backslash "\" for delimiting subdirectories.
  5571.  
  5572. In order to reach the very widest audience, you may also wish
  5573. to take into account filenames which may have originated on
  5574. non-PC systems.  In such filenames, the length of any part of
  5575. the path will not necessarily be restricted to the 11-plus-dot
  5576. of MS-DOS, the dot character may not mean anything special,
  5577. uppercase/lowercase distinctions may be significant, and
  5578. characters may be present which are not valid in MS-DOS names.
  5579.  
  5580. Routines in this series include:
  5581.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5582.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5583.  
  5584.    FileName$ = SPACE$(80)
  5585.    GetNameA FileName$, NameLen%
  5586.    FileName$ = LEFT$(FileName$, NameLen%)
  5587.  
  5588. -------
  5589. FileName$   file name (init to >= 12 characters, preferably 80)
  5590. NameLen%    length of file name
  5591.  
  5592. Name  : GetNameF             (Get Name of File)
  5593. Class : Disk
  5594. Level : DOS
  5595.  
  5596. The GetNameF routine returns the name of a file matched by
  5597. FindFirstF or FindNextF.  The name will not contain a drive or
  5598. subdirectory specification.
  5599.  
  5600. Routines in this series include:
  5601.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5602.    GetTimeF, GetSizeFL
  5603.  
  5604.    FileName$ = SPACE$(12)
  5605.    GetNameF FileName$, NameLen%
  5606.    FileName$ = LEFT$(FileName$, NameLen%)
  5607.  
  5608. -------
  5609. FileName$   file name (init to at least 12 characters)
  5610. NameLen%    length of file name
  5611.  
  5612. Name  : GetNameFx$           (Get Name of File, Extended)
  5613. Class : Disk
  5614. Level : DOS
  5615.  
  5616. The GetNameFx$ function returns the name of a file matched by
  5617. FindFirstFx or FindNextFx.  The name will not contain a drive
  5618. or subdirectory specification.
  5619.  
  5620. Routines in this series include:
  5621.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5622.    GetTimeFx$, GetSizeFx&
  5623.  
  5624.    FileName$ = GetNameFx$(Buffer$)
  5625.  
  5626. Buffer$       buffer used in search
  5627. -------
  5628. FileName$     file name
  5629.  
  5630. Name  : GetPrtAddr           (Get Printer Address)
  5631. Class : Printer
  5632. Level : Clone
  5633.  
  5634. This routine allows you to determine the base port address of a
  5635. parallel port.  You tell it the LPT port number (1-4) and it
  5636. returns the port address. If there is no port installed, zero
  5637. will be returned.
  5638.  
  5639. Note that up to four printer ports are (theoretically)
  5640. supported on most machines.  On PS/2 computers, only three
  5641. ports are allowed, and the fourth port data area is used for
  5642. other purposes.  So, it would probably be a good idea to
  5643. restrict your program to ports 1-3.
  5644.  
  5645. Aside from purely informational purposes, this routine can be
  5646. useful in conjunction with SetPrtAddr in manipulating the
  5647. parallel ports.
  5648.  
  5649.    GetPrtAddr PortNr%, PortAddr%
  5650.  
  5651. PortNr%     LPT port number (1-4 or 1-3 [see above])
  5652. -------
  5653. PortAddr%   port address
  5654.  
  5655. Name  : GetPrtSc%            (Get PrtSc press)
  5656. Class : Input
  5657. Level : BIOS
  5658.  
  5659. This function only works when the "print screen" key is
  5660. disabled, which you can accomplish via the PrtSc routine.  It
  5661. returns whether the print screen key was pressed since you last
  5662. checked.  Like INKEY$, it clears the value after you read it.
  5663.  
  5664.    Pressed% = GetPrtSc%
  5665.  
  5666. -------
  5667. Pressed%    whether the print screen key was pressed (0 if no)
  5668.  
  5669. Name  : GetPSP%              (Get Program Segment Prefix)
  5670. Class : Memory
  5671. Level : DOS
  5672.  
  5673. This function returns the segment of the Program Segment
  5674. Prefix, which is a sort of header at the beginning of every
  5675. program that contains assorted information.  You can find out
  5676. more about the PSP in any DOS technical reference.
  5677.  
  5678.    PSeg% = GetPSP%
  5679.  
  5680. -------
  5681. PSeg%      segment of the Program Segment Prefix
  5682.  
  5683. Name  : GetRows              (Get Rows on screen)
  5684. Class : Display
  5685. Level : Clone
  5686.  
  5687. This routine tells you how many rows are on the display.  This
  5688. is normally 25, but it may be greater on an EGA or VGA.  Only
  5689. text modes are supported.
  5690.  
  5691.    GetRows Rows%
  5692.  
  5693. -------
  5694. Rows%    text rows on the display
  5695.  
  5696. Name  : GetRows2%            (Get Rows on screen)
  5697. Class : Display
  5698. Level : Clone
  5699.  
  5700. This routine tells you how many rows are on the display.  This
  5701. is normally 25, but it may be greater on an EGA or VGA.  Only
  5702. text modes are supported.
  5703.  
  5704.    Rows% = GetRows2%
  5705.  
  5706. -------
  5707. Rows%    text rows on the display
  5708.  
  5709. Name  : GetScreen            (Get Screen)
  5710. Class : Display
  5711. Level : Clone
  5712.  
  5713. This routine saves any portion of the display to an array.
  5714. Only text modes are supported.  If your program uses multiple
  5715. display pages, you can get an image from any of those pages.  A
  5716. special "slow" mode is supported for the CGA, to prevent
  5717. flickering (a problem only with some CGAs).
  5718.  
  5719. The size of the integer array needed to store a specific area
  5720. of the screen can be calculated using the CalcSize routine
  5721. (see).
  5722.  
  5723. If you wish to save the entire screen, you may find ScrSave
  5724. easier (see).
  5725.  
  5726.    GetScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  5727.  
  5728. TRow%      top row of the desired screen area
  5729. LCol%      left column of the desired screen area
  5730. BRow%      bottom row of the desired screen area
  5731. RCol%      right column of the desired screen area
  5732. Page%      page from which to get the display area
  5733. Fast%      whether to use fast mode (0 no)
  5734. -------
  5735. Array%()   stored image of the selected area of the screen
  5736.  
  5737. Name  : GetSerial$           (Get disk Serial number)
  5738. Class : Disk
  5739. Level : DOS 4.0+
  5740.  
  5741. The GetSerial function returns the serial number of the
  5742. specified disk.  If there is no serial number, it returns
  5743. "0000-0000".
  5744.  
  5745.    SerialNr$ = GetSerial$(Drive$)
  5746.  
  5747. Drive$       drive to get serial # from ("" for current drive)
  5748. -------
  5749. SerialNr$    serial number of the specified drive
  5750.  
  5751. Name  : GetSizeAL            (Get Size of file in Archive Long)
  5752. Class : Disk
  5753. Level : DOS
  5754.  
  5755. GetSizeAL returns the size of an archived file matched by the
  5756. FindFirstA or FindNextA routines.
  5757.  
  5758. Routines in this series include:
  5759.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5760.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5761.  
  5762.    GetSizeAL OrigSize&, CurrSize&
  5763.  
  5764. -------
  5765. OrigSize&    original (uncompressed) file size
  5766. CurrSize&    current (compressed) file size
  5767.  
  5768. Name  : GetSizeFL            (Get Size of File as Long)
  5769. Class : Disk
  5770. Level : DOS
  5771.  
  5772. The GetSizeFL routine returns the size of a file matched by
  5773. FindFirstF or FindNextF.
  5774.  
  5775. Routines in this series include:
  5776.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5777.    GetTimeF, GetSizeFL
  5778.  
  5779.    GetSizeFL FileSize&
  5780.  
  5781. -------
  5782. FileSize&   file size
  5783.  
  5784. Name  : GetSizeFx&           (Get Size of File, Extended)
  5785. Class : Disk
  5786. Level : DOS
  5787.  
  5788. The GetSizeFx& function returns the size of a file matched by
  5789. FindFirstFx or FindNextFx.
  5790.  
  5791. Routines in this series include:
  5792.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5793.    GetTimeFx$, GetSizeFx&
  5794.  
  5795.    FileSize& = GetSizeFx&(Buffer$)
  5796.  
  5797. Buffer$     buffer used in search
  5798. -------
  5799. FileSize&   file size
  5800.  
  5801. Name  : GetStoreA            (Get Storage of file in Archive)
  5802. Class : Disk / Time
  5803. Level : DOS
  5804.  
  5805. GetStoreA returns the method used to compress an archived file
  5806. matched by the FindFirstA or FindNextA routines.
  5807.  
  5808. Routines in this series include:
  5809.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5810.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5811.  
  5812.    Storage$ = SPACE$(8)
  5813.    GetStoreA Storage$
  5814.  
  5815. -------
  5816. Storage$    storage method (init to 8 characters)
  5817.  
  5818. Name  : GetSub               (Get default Subdirectory)
  5819. Class : Disk
  5820. Level : DOS
  5821.  
  5822. The GetSub routine gets the current subdirectory on the default
  5823. drive.  It does not put a backslash at the start of the
  5824. subdirectory, so you should add this yourself.
  5825.  
  5826. See also GetSub1, which is a more advanced version of this
  5827. routine.
  5828.  
  5829.    SubDir$ = SPACE$(64)
  5830.    GetSub SubDir$, SubLen%
  5831.    SubDir$ = "\" + LEFT$(SubDir$, SubLen%)
  5832.  
  5833. -------
  5834. SubDir$    name of the current subdirectory. Init to 64+ chars
  5835. SubLen%    length of the subdirectory name
  5836.  
  5837. Name  : GetSub1              (Get default Subdirectory)
  5838. Class : Disk
  5839. Level : DOS
  5840.  
  5841. The GetSub1 routine gets the current subdirectory on a
  5842. specified drive. Unlike GetSub, it places a backslash at the
  5843. start of the name.  It also returns an error code, which allows
  5844. you to see if there was a disk error.
  5845.  
  5846. If you don't care about the error code, you may prefer GetSub2,
  5847. the FUNCTION version of this routine.
  5848.  
  5849.    SubDir$ = SPACE$(65)
  5850.    GetSub1 Drive$, SubDir$, SubLen%, ErrCode%
  5851.    SubDir$ = LEFT$(SubDir$, SubLen%)
  5852.  
  5853. Drive$     letter of the drive to check
  5854. -------
  5855. SubDir$    name of the current subdirectory. Init to 65+ chars
  5856. SubLen%    length of the subdirectory name
  5857. ErrCode%   error code: 0 if no error, else DOS Error
  5858.  
  5859. Name  : GetSub2$             (Get default Subdirectory)
  5860. Class : Disk
  5861. Level : DOS
  5862.  
  5863. The GetSub2 routine gets the current subdirectory on a
  5864. specified drive. Unlike GetSub, it places a backslash at the
  5865. start of the name.
  5866.  
  5867. See also GetSub1, the SUB version of this routine.  It returns
  5868. an error code.
  5869.  
  5870. If you just want the subdirectory of the current drive, you can
  5871. use a null string ("") as the drive letter.
  5872.  
  5873.    SubDir$ = GetSub2$(Drive$)
  5874.  
  5875. Drive$     letter of the drive to check
  5876. -------
  5877. SubDir$    name of the current subdirectory. Init to 65+ chars
  5878.  
  5879. Name  : GetSwitch            (Get Switch character)
  5880. Class : Miscellaneous
  5881. Level : DOS
  5882.  
  5883. An undocumented capability in many DOS versions allows you to
  5884. set the DOS "switch character", which is the delimiter used to
  5885. identify a switch on the DOS command line.  This is normally a
  5886. slash, as in "DIR /W".  However, many people prefer to change
  5887. it to a "-", which is the switch character used by Unix.
  5888.  
  5889. With the normal "/" delimiter, a backslash "\" is used in
  5890. subdirectory specifications.  DOS itself will recognize either
  5891. one as a subdirectory delimiter, but the command line won't
  5892. unless the switch char was changed.
  5893.  
  5894. The upshot of all this is, whereas you might normally use a
  5895. command like:
  5896.    DIR /W C:\GAMES
  5897.  
  5898. Someone with a different switch character might use something
  5899. like this:
  5900.    DIR -W C:/GAMES
  5901.  
  5902. This is exactly the sort of syntax that Unix commands use.
  5903.  
  5904. If you design your program to recognize the different
  5905. delimiters, you will make some people very happy!  The
  5906. GetSwitch routine will detect changed delimiters on those
  5907. versions of DOS which support it, and will return an ordinary
  5908. "/" on those versions of DOS which don't.
  5909.  
  5910.    Switch$ = "x"
  5911.    GetSwitch Switch$
  5912.  
  5913. -------
  5914. Switch$    the DOS switch character.  Init to one character.
  5915.  
  5916. Name  : GetSwitch2$          (Get Switch character)
  5917. Class : Miscellaneous
  5918. Level : DOS
  5919.  
  5920. This does exactly the same thing as the GetSwitch routine, but
  5921. it is a FUNCTION rather than a SUB.  For more information, see
  5922. GetSwitch.
  5923.  
  5924.    Switch$ = GetSwitch2$
  5925.  
  5926. -------
  5927. Switch$    the DOS switch character
  5928.  
  5929. Name  : GetTick&             (Get Tick)
  5930. Class : Time
  5931. Level : Clone
  5932.  
  5933. This function returns the system time.  This value represents
  5934. the time after midnight. There are about 18.2 ticks per second,
  5935. providing sufficiently fine resolution for most purposes.
  5936.  
  5937. If you use this function as part of a delay loop, keep in mind
  5938. that the value will wrap around at midnight, and that any given
  5939. value may be "skipped" due to causes beyond your control--
  5940. multitasking or background operations such as communications or
  5941. print spooling, for example.  So, DO NOT check for a specific
  5942. "end time"-- it may never come!  Instead, decrement a counter
  5943. whenever you notice that the time has changed since you last
  5944. checked.  This disassociates the delay from a specific time,
  5945. preventing lockups.
  5946.  
  5947.    Tick& = GetTick&
  5948.  
  5949. -------
  5950. Tick&        time after midnight (1/18.2 seconds)
  5951.  
  5952. Name  : GetTime              (Get Time)
  5953. Class : Time
  5954. Level : DOS
  5955.  
  5956. This routine tells you the time according to DOS.
  5957.  
  5958. The main difference between getting the time from BASIC and
  5959. getting it from DOS is the "hundredths of seconds" value.
  5960. However, this value is not available on some machines, in which
  5961. case it will be set to zero.  It is not accurate on most
  5962. machines, being calculated instead using a semi-random
  5963. approach; it is more of a novelty than a useful value.
  5964.  
  5965.    GetTime HourNr%, MinuteNr%, SecondNr%, Hundredth%
  5966.  
  5967. -------
  5968. HourNr%      hour (0-23)
  5969. MinuteNr%    minute
  5970. SecondNr%    second
  5971. Hundredth%   hundredth of a second.  See remarks, above.
  5972.  
  5973. Name  : GetTimeA             (Get Time of file in Archive)
  5974. Class : Disk / Time
  5975. Level : DOS
  5976.  
  5977. GetTimeA returns the time of an archived file matched by the
  5978. FindFirstA or FindNextA routines.
  5979.  
  5980. Routines in this series include:
  5981.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5982.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5983.  
  5984.    GetTimeA HourNr%, MinuteNr%, SecondNr%
  5985.  
  5986. -------
  5987. HourNr%     hour
  5988. MinuteNr%   minute
  5989. SecondNr%   second
  5990.  
  5991. Name  : GetTimeAT            (Get Time from AT clock)
  5992. Class : Time
  5993. Level : BIOS (AT)
  5994.  
  5995. This routine gets the time from the hardware real-time clock in
  5996. AT-class computers.  Depending on the DOS version, this time
  5997. may be partially or completely independent of the time kept by
  5998. DOS in software.  DOS always reads the time from the hardware
  5999. clock when it starts up.  However, use of the TIME command in
  6000. DOS (and the TIME$ function in QuickBASIC) may relate only to
  6001. the software copy of the time, which is not always guaranteed
  6002. to be the same as the time in the hardware clock due to certain
  6003. discrepancies in DOS.
  6004.  
  6005.    GetTimeAT HourNr%, MinuteNr%, SecondNr%, ErrCode%
  6006.  
  6007. -------
  6008. HourNr%      hour (0-23)
  6009. MinuteNr%    minute
  6010. SecondNr%    second
  6011. ErrCode%     error code: 0 if no error, else clock has stopped
  6012.  
  6013. Name  : GetTimeF             (Get Time of File)
  6014. Class : Disk / Time
  6015. Level : DOS
  6016.  
  6017. The GetTimeF routine returns the time of a file matched by
  6018. FindFirstF or FindNextF.
  6019.  
  6020. Routines in this series include:
  6021.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  6022.    GetTimeF, GetSizeFL
  6023.  
  6024.    GetTimeF HourNr%, MinuteNr%, SecondNr%
  6025.  
  6026. -------
  6027. HourNr%     hour
  6028. MinuteNr%   minute
  6029. SecondNr%   second
  6030.  
  6031. Name  : GetTimeFx$           (Get Time of File, Extended)
  6032. Class : Disk / Time
  6033. Level : DOS
  6034.  
  6035. The GetTimeFx$ function returns the time of a file matched by
  6036. FindFirstFx or FindNextFx.
  6037.  
  6038. Routines in this series include:
  6039.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  6040.    GetTimeFx$, GetSizeFx&
  6041.  
  6042.    FileTime$ = GetTimeFx$(Buffer$)
  6043.  
  6044. Buffer$      buffer used in search
  6045. -------
  6046. FileTime$    file time (e.g., "17:53:20")
  6047.  
  6048. Name  : GetTView             (Get TopView)
  6049. Class : Miscellaneous
  6050. Level : BIOS
  6051.  
  6052. This routine tells you whether TopView or a compatible
  6053. multitasker (such as TaskView or DESQview) is loaded.
  6054.  
  6055. See also GetDView, GetTVScreen, UpdTVScreen.
  6056.  
  6057.    GetTView Installed%
  6058.  
  6059. -------
  6060. Installed%   whether a TopView-type multitasker is loaded
  6061.  
  6062. Name  : GetTVScreen          (Get TopView Screen address)
  6063. Class : Display / Miscellaneous
  6064. Level : BIOS
  6065.  
  6066. GetTVScreen returns the address of the screen buffer used by a
  6067. TopView-type multitasker.  This allows you to use direct screen
  6068. access while remaining within the windows allocated to your
  6069. program by the multitasker.
  6070.  
  6071. You must tell the multitasker the address of the screen you
  6072. would be writing to if the multitasker was not installed.
  6073. Specify a segment of &HB000 if using an MDA or Hercules, or a
  6074. segment of &HB800 for CGA, EGA, MCGA or VGA. The offset should
  6075. always be 0.  This is for use in text modes.
  6076.  
  6077. The routine will return with the new segment and offset for you
  6078. to use. These values can be used with any PBClone screen
  6079. routine that accepts a segment and offset-- DQPrint and
  6080. DXQPrint, for example.
  6081.  
  6082. Note that not all TopView-compatible multitaskers will
  6083. automatically update the screen from the buffer.  The
  6084. UpdTVScreen routine allows you to force a screen update.
  6085.  
  6086. See also GetDView, GetTView, UpdTVScreen.
  6087.  
  6088.    GetTVScreen DSeg%, DOfs%
  6089.  
  6090. DSeg%       segment of desired screen
  6091. DOfs%       offset of desired screen
  6092. -------
  6093. DSeg%       segment of screen buffer
  6094. DOfs%       offset of screen buffer
  6095.  
  6096. Name  : GetValidKey          (Get Valid Key)
  6097. Class : Input
  6098. Level : DOS
  6099.  
  6100. This one is useful for getting one of a list of keys from the
  6101. keyboard.  You give it a list of keys (letters should be
  6102. uppercase) to accept.  It will wait until one of the listed
  6103. keys is pressed; for letters, it will accept either lowercase
  6104. or uppercase keys, but will convert the letter to uppercase
  6105. before it returns to you.  If you pass it a blank list, it will
  6106. accept any key.
  6107.  
  6108. This routine is handy for when you want to allow one of a list
  6109. of choices from a menu, for instance.
  6110.  
  6111.    GetValidKey GoodList$, Result$
  6112.  
  6113. GoodList$    list of acceptable keys.  See above for remarks.
  6114. -------
  6115. Result$      the key that was accepted (uppercase if letter)
  6116.  
  6117. Name  : GetVerify            (Get Verify setting)
  6118. Class : Disk
  6119. Level : DOS
  6120.  
  6121. The GetVerify routine tells you the state of the DOS VERIFY
  6122. flag.  When VERIFY is on, some checking is done to make sure
  6123. that writing to the disk works as requested.  The checks are
  6124. not very good, however, and VERIFY slows down disk handling, so
  6125. it is usually better to have VERIFY off.
  6126.  
  6127. You can change the state of VERIFY by using the DOS VERIFY
  6128. command or with the SetVerify routine in PBClone.
  6129.  
  6130.    GetVerify VerifyOn%
  6131.  
  6132. -------
  6133. VerifyOn%   whether VERIFY is on (0 if no)
  6134.  
  6135. Name  : GetVGA               (Get VGA information)
  6136. Class : Display / Equipment
  6137. Level : BIOS
  6138.  
  6139. This routine tells you whether a VGA is available.
  6140.  
  6141. See also GetCRT, GetEGA and GetHGA.
  6142.  
  6143.    GetVGA IsVGA%
  6144.  
  6145. -------
  6146. IsVGA%    whether a VGA is installed (0 if no)
  6147.  
  6148. Name  : GetVGA2%             (Get VGA information)
  6149. Class : Display / Equipment
  6150. Level : BIOS
  6151.  
  6152. This routine tells you whether a VGA is available.
  6153.  
  6154. See also GetCRT, GetEGA and GetHGA.
  6155.  
  6156.    IsVGA% = GetVGA2%
  6157.  
  6158. -------
  6159. IsVGA%    whether a VGA is installed (0 if no)
  6160.  
  6161. Name  : GetVGAColor          (Get VGA Color)
  6162. Class : Display
  6163. Level : BIOS
  6164.  
  6165. This routine gets the components of a single VGA palette color.
  6166. It returns the color value associated with a given color number.
  6167.  
  6168. If you are dealing with more than one color at a time, you may
  6169. find GetVGAPalette more appropriate.
  6170.  
  6171.    GetVGAColor ColorNr%, Red%, Green%, Blue%
  6172.  
  6173. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  6174. -------
  6175. Red%       red intensity (0-63)
  6176. Green%     green intensity (0-63)
  6177. Blue%      blue intensity (0-63)
  6178.  
  6179. Name  : GetVGAPalette        (Get VGA Palette)
  6180. Class : Display
  6181. Level : BIOS
  6182.  
  6183. This routine allows you to get any number of the VGA palette
  6184. settings into a TYPEd array.  The TYPE for the array should be
  6185. defined like this:
  6186.  
  6187.    TYPE Palet
  6188.       IRed AS STRING * 1
  6189.       IBlue AS STRING * 1
  6190.       IGreen AS STRING * 1
  6191.    END TYPE
  6192.  
  6193. This type holds a CHR$-encoded representation of the intensity
  6194. of each component of the color.  The values range from 0-63.
  6195.  
  6196. If you are only dealing with a few colors, you may find it more
  6197. convenient to use GetVGAColor instead.
  6198.  
  6199.    GetVGAPalette DSeg%, DOfs%, Start%, Colors%
  6200.  
  6201. DSeg%      segment of the palette array
  6202. DOfs%      offset of the palette array
  6203. Start%     color number to start with
  6204. Colors%    number of colors to get
  6205.  
  6206. Name  : GetVidMode           (Get Video Mode)
  6207. Class : Display
  6208. Level : BIOS
  6209.  
  6210. The GetVidMode routine tells you about the current display
  6211. status from the BIOS' point of view.  Note that the BIOS
  6212. display mode is not the same as the BASIC SCREEN mode (a direct
  6213. translation between the two is messy, because BASIC
  6214. conglomerates several BIOS modes into a single SCREEN mode in
  6215. several instances).
  6216.  
  6217.    GetVidMode BIOSMode%, ScreenWidth%, ActivePage%
  6218.  
  6219. -------
  6220. BIOSMode%     BIOS video mode
  6221. ScreenWidth%  number of columns per row
  6222. ActivePage%   active (visible) display page
  6223.  
  6224. Name  : GetXMSm              (Get XMS Memory)
  6225. Class : Memory / Equipment
  6226. Level : DOS
  6227.  
  6228. This routine tells you how much XMS memory is available.  If
  6229. there is none, or if the XMS driver hasn't been installed, it
  6230. returns zeroes.  Memory is returned kilobytes.
  6231.  
  6232.    GetXMSm LargestFree&, TotalFree&
  6233.  
  6234. -------
  6235. LargestFree&  largest free block of XMS memory
  6236. TotalFree&    total free XMS memory
  6237.  
  6238. Name  : GetXMSv              (Get XMS Version)
  6239. Class : Memory / Equipment
  6240. Level : BIOS
  6241.  
  6242. The GetXMSv routine tells you the version of XMS driver that is
  6243. being used. The version number is separated into major and
  6244. minor parts.  For example, an XMS 2.0 driver would return a
  6245. major number of 2 and minor number of 0.
  6246.  
  6247.    GetXMSv MajorVer%, MinorVer%
  6248.  
  6249. -------
  6250. MajorVer%  major part of the XMS version number
  6251. MinorVer%  minor part of the XMS version number
  6252.  
  6253. Name  : GLoad                (Graphics Load)
  6254. Class : Disk
  6255. Level : DOS
  6256.  
  6257. A replacement for the BASIC BLOAD statement, this routine loads
  6258. a binary memory image from a file into the area of memory it
  6259. formerly occupied.  This is most often used to restore a screen
  6260. display from a file, although PBClone offers more flexible
  6261. alternatives.
  6262.  
  6263.    GLoad FileName$
  6264.  
  6265. FileName$    name of the file to load into memory
  6266.  
  6267. Name  : GQPrint              (Graphics Quick Print)
  6268. Class : Display
  6269. Level : Clone
  6270.  
  6271. This is a simple high-speed replacement for the PRINT statement
  6272. which works in CGA graphics mode (SCREEN 2).  It does not
  6273. interpret control codes, support graphics characters (ASCII
  6274. 128-255), or update the cursor position, in return for which it
  6275. is much faster than PRINT.
  6276.  
  6277. The Fast% parameter is ignored at the moment-- top speed is
  6278. always used, which may cause flickering on some CGAs.
  6279.  
  6280.    GQPrint St$, Row%, Column%, Fast%
  6281.  
  6282. St$      string to display
  6283. Row%     row (1-25)
  6284. Column%  column (1-80)
  6285. Fast%    not used
  6286.  
  6287. Name  : GrafPrint            (Graphics Print)
  6288. Class : Display
  6289. Level : Clone
  6290.  
  6291. This is a flexible replacement for the PRINT statement which
  6292. operates in graphics mode.  It allows you to display text at
  6293. graphics coordinates instead of text coordinates for better
  6294. alignment with graphs and so forth.  It also lets you specify
  6295. the size of the font-- you can stretch it in either vertical or
  6296. horizontal directions, or both, using a font multiplier value.
  6297.  
  6298. The disadvantages of this routine are that it is slower than an
  6299. ordinary PRINT, only does foreground printing (if you need a
  6300. background color, you need to fill that in yourself
  6301. beforehand), won't do automatic wrap or scroll, and won't
  6302. handle control codes or graphics characters (ASCII 0-31,
  6303. 127-255). The font is based on the normal CGA graphics font,
  6304. which uses an 8x8 grid for each character.
  6305.  
  6306. GrafPrint will work in any graphics mode.
  6307.  
  6308.    GrafPrint St$, X%, Y%, High%, Wide%, Colour%
  6309.  
  6310. St$       string to display
  6311. X%        graphics column to start at
  6312. Y%        graphics row to start at
  6313. High%     font height multiplier
  6314. Wide%     font width multiplier
  6315. Colour%   foreground color for string
  6316.  
  6317. Name  : GrafRest             (Graphics Restore)
  6318. Class : Display
  6319. Level : Clone
  6320.  
  6321. This routine allows you to restore a SCREEN 1 (CGA, 320x200, 4
  6322. color) or SCREEN 2 (CGA, 640x200, 2 color) display that was
  6323. saved using GrafSave (see).
  6324.  
  6325.    GrafRest DSeg%, DOfs%
  6326.  
  6327. DSeg%      segment of storage array, returned by VARSEG
  6328. DOfs%      offset  of storage array, returned by VARPTR
  6329.  
  6330. Name  : GrafSave             (Graphics Save)
  6331. Class : Display
  6332. Level : Clone
  6333.  
  6334. This routine allows you to save a SCREEN 1 (CGA, 320x200, 4
  6335. color) or SCREEN 2 (CGA, 640x200, 2 color) display that can be
  6336. restored using GrafRest (see).
  6337.  
  6338. The array used to hold the screen must contain 16,000 bytes.
  6339. For an integer array, this means that you must create the array
  6340. by DIM Array%(1 TO 8000).
  6341.  
  6342.    GrafSave DSeg%, DOfs%
  6343.  
  6344. DSeg%      segment of storage array, returned by VARSEG
  6345. DOfs%      offset  of storage array, returned by VARPTR
  6346.  
  6347. Name  : GXQPrint             (Graphics Extended Quick Print)
  6348. Class : Display
  6349. Level : Clone
  6350.  
  6351. This is a simple high-speed replacement for the PRINT statement
  6352. which works in CGA graphics mode (SCREEN 1).  It does not
  6353. interpret control codes, support graphics characters (ASCII
  6354. 128-255), or update the cursor position, in return for which it
  6355. is much faster than PRINT.
  6356.  
  6357. This routine can also be used in SCREEN 2, where it will
  6358. display the string in shades instead of in color (using 40
  6359. columns/row).
  6360.  
  6361. The Fast% parameter is ignored at the moment-- top speed is
  6362. always used, which may cause flickering on some CGAs.
  6363.  
  6364.    GXQPrint St$, Row%, Column%, Fore%, Fast%
  6365.  
  6366. St$      string to display
  6367. Row%     row (1-25)
  6368. Column%  column (1-40)
  6369. Fore%    foreground color (0-3)
  6370. Fast%    not used
  6371.  
  6372. Name  : GXQPrint1            (Graphics Extended Quick Print)
  6373. Class : Display
  6374. Level : Clone
  6375.  
  6376. This is a high-speed replacement for the PRINT statement which
  6377. works in CGA graphics mode (SCREEN 1).  It does not interpret
  6378. control codes or update the cursor position, in return for
  6379. which it is much faster than PRINT.
  6380.  
  6381. This routine can also be used in SCREEN 2, where it will
  6382. display the string in shades instead of in color (using 40
  6383. columns/row).
  6384.  
  6385. The Fast% parameter is ignored at the moment-- top speed is
  6386. always used, which may cause flickering on some CGAs.
  6387.  
  6388.    GXQPrint1 St$, Row%, Column%, Fore%, Back%, Fast%
  6389.  
  6390. St$      string to display
  6391. Row%     row (1-25)
  6392. Column%  column (1-40)
  6393. Fore%    foreground color (0-3)
  6394. Back%    background color (0-3)
  6395. Fast%    not used
  6396.  
  6397. Name  : HandleInfo           (Handle Information)
  6398. Class : Miscellaneous
  6399. Level : DOS
  6400.  
  6401. HandleInfo tells you whether a file handle refers to a file or
  6402. to a device. If the handle does not exist, an error code will
  6403. be returned.
  6404.  
  6405. This is for file handles as returned by FOpen1 and FCreate. It
  6406. can also be used with file numbers associated with OPEN, via a
  6407. BASIC function that was introduced with QuickBASIC 4.0:
  6408.  
  6409.    Handle% = FILEATTR(FileNumber%, 2)
  6410.  
  6411. See FClose1 for a list of predefined handles.
  6412.  
  6413.    HandleInfo Handle%, Device%, ErrCode%
  6414.  
  6415. Handle%    file handle
  6416. -------
  6417. Device%    whether the handle refers to a device (0 no)
  6418. ErrCode%   whether there was an error (0 no)
  6419.  
  6420. Name  : HCls                 (Hercules CLS)
  6421. Class : Display
  6422. Level : Clone
  6423.  
  6424. This routine clears a Hercules graphics screen to the specified
  6425. color.
  6426.  
  6427. Routines in this series are:
  6428.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6429.  
  6430.    HCls Colour%
  6431.  
  6432. Colour%    color (0-1)
  6433.  
  6434. Name  : HiByte%              (High Byte)
  6435. Class : Numeric
  6436. Level : Any
  6437.  
  6438. This function returns the high byte of an integer.
  6439.  
  6440.    Byte% = HiByte%(Nr%)
  6441.  
  6442. Nr%        integer
  6443. -------
  6444. Byte%      value of the most significant byte
  6445.  
  6446. Name  : HiLite               (Highlight)
  6447. Class : Display
  6448. Level : Clone
  6449.  
  6450. This routine allows you to highlight text on the screen.  It
  6451. works in text modes only and always displays to the visible
  6452. screen page.
  6453.  
  6454. See also ReColorArea, which lets you highlight any rectangular
  6455. area of the screen.
  6456.  
  6457.    HiLite Row%, LCol%, RCol%, VAttr%
  6458.  
  6459. Row%       row on which to highlight
  6460. LCol%      left column (where highlight starts)
  6461. RCol%      right column (where highlight ends)
  6462. VAttr%     new color (see CalcAttr)
  6463.  
  6464. Name  : HiWord%              (High Word)
  6465. Class : Numeric
  6466. Level : Any
  6467.  
  6468. This function returns the high word of a long integer.
  6469.  
  6470.    Word% = HiWord%(Nr&)
  6471.  
  6472. Nr&        long integer
  6473. -------
  6474. Word%      value of the most significant word
  6475.  
  6476. Name  : HLine                (Hercules LINE)
  6477. Class : Display
  6478. Level : Clone
  6479.  
  6480. This routine draws a line on a Hercules graphics screen.
  6481.  
  6482. Routines in this series are:
  6483.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6484.  
  6485.    HLine X1%, Y1%, X2%, Y2%, Colour%
  6486.  
  6487. X1%        starting graphics column (0-719)
  6488. Y1%        starting graphics row (0-347)
  6489. X2%        ending graphics column (0-719)
  6490. Y2%        ending graphics row (0-347)
  6491. Colour%    color (0-1)
  6492.  
  6493. Name  : HMode                (Hercules Mode)
  6494. Class : Display
  6495. Level : Clone
  6496.  
  6497. This routine switches between text mode and Hercules graphics
  6498. mode.  Use HInit first to initialize the graphics mode
  6499. appropriately.
  6500.  
  6501. HMode will clear page 0 when graphics mode is entered.  Page 1,
  6502. if it exists, is not cleared.  PBClone does not support page 1
  6503. in any respect.
  6504.  
  6505. Routines in this series are:
  6506.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6507.  
  6508.    HMode Graphics%
  6509.  
  6510. Graphics%    display mode to set (0 text, else graphics)
  6511.  
  6512. Name  : HPrint               (Hercules Print)
  6513. Class : Display
  6514. Level : Clone
  6515.  
  6516. This routine displays text in Hercules graphics mode.   It uses
  6517. the full resolution of the screen, so text is 90 columns by 43
  6518. rows.  This gives you more space than even the largest EGA text
  6519. mode, which is only 80x43.
  6520.  
  6521. Routines in this series are:
  6522.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6523.  
  6524.    HPrint St$, Row%, Column%
  6525.  
  6526. St$        text to display
  6527. Row%       row (1-43)
  6528. Column%    column (1-90)
  6529.  
  6530. Name  : HSetPixel            (Hercules Set Pixel)
  6531. Class : Display
  6532. Level : Clone
  6533.  
  6534. This routine draws a dot on a Hercules graphics screen.
  6535.  
  6536. Routines in this series are:
  6537.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6538.  
  6539.    HSetPixel X%, Y%, Colour%
  6540.  
  6541. X%         graphics column (0-719)
  6542. Y%         graphics row (0-347)
  6543. Colour%    color (0-1)
  6544.  
  6545. Name  : HTestPixel           (Hercules Test Pixel)
  6546. Class : Display
  6547. Level : Clone
  6548.  
  6549. This routine returns the color of a dot on a Hercules graphics
  6550. screen.
  6551.  
  6552. Routines in this series are:
  6553.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6554.  
  6555.    Colour% = HTestPixel%(X%, Y%)
  6556.  
  6557. X%         graphics column (0-719)
  6558. Y%         graphics row (0-347)
  6559. -------
  6560. Colour%    color (0-1)
  6561.  
  6562. Name  : IdentifyFile         (Identify File)
  6563. Class : Disk
  6564. Level : DOS
  6565.  
  6566. Given a file name, this routine attempts to identify what kind
  6567. of file it is. Most information is derived from the file
  6568. extension, but some files are processed more deeply.  For
  6569. instance, a file named "UNKNOWN.BAS" will be checked to see if
  6570. it is source code (tokenized GWBASIC format, tokenized
  6571. QuickBASIC format, or plain ASCII text) or a binary BSAVE/BLOAD
  6572. image (which is further categorized as to whether it is a
  6573. screen image, and if so, for what kind of display).
  6574.  
  6575.    Descript$ = SPACE$(80)
  6576.    IdentifyFile FileName$, Descript$, DescrLen%
  6577.    Descript$ = LEFT$(Descript$, DescrLen%)
  6578.  
  6579. FileName$    name of the file to identify
  6580. -------
  6581. Descript$    description of the file (init to at least 80 chars)
  6582. DescrLen%    length of the description
  6583.  
  6584. Name  : InitPtr              (Initialize Pointers)
  6585. Class : Array management
  6586. Level : Any
  6587.  
  6588. This routine initializes an array of pointers for use with the
  6589. pointer sort routines (PSortD, et al).  It may also be useful
  6590. for other purposes.  Each element of the array is set equal to
  6591. its index (the first element is set to 1, the second to 2, and
  6592. so forth).  Arrays are expected to begin at element 1.  You may
  6593. specify the last element to initialize, allowing you to use
  6594. only part of an array.
  6595.  
  6596.    InitPtr Ptr%(), Elements%
  6597.  
  6598. Ptr%()      array to initialize
  6599. Elements%   number of elements to initialize
  6600. -------
  6601. Ptr%()      initialized array
  6602.  
  6603. Name  : InsChr               (Insert Character)
  6604. Class : Display
  6605. Level : Clone
  6606.  
  6607. The InsChr routine inserts a space at the specified screen
  6608. location.
  6609.  
  6610.    InsChr Row%, Column%
  6611.  
  6612. Row%      row of character
  6613. Column%   column of character
  6614.  
  6615. Name  : InsLine              (Insert Line)
  6616. Class : Display
  6617. Level : BIOS
  6618.  
  6619. This routine inserts a blank line at the specified row of the
  6620. screen.
  6621.  
  6622.    InsLine Row%, VAttr%
  6623.  
  6624. Row%      row to insert
  6625. VAttr%    color/attribute to use on new row (see CalcAttr)
  6626.  
  6627. Name  : Int2Date             (Integer to Date)
  6628. Class : Time
  6629. Level : Any
  6630.  
  6631. This routine undoes the results of the Date2Int routine.  It
  6632. expands a single integer into month, day, and year values.
  6633.  
  6634. The storage format is identical to that used by DOS for file
  6635. dates, by the way, so this routine makes an apt companion for
  6636. LoadDirFull.
  6637.  
  6638.  
  6639. See also Int2DateSt$, a version of this routine which returns a
  6640. string instead of numbers.
  6641.  
  6642.  
  6643.    Int2Date MonthNr%, DayNr%, YearNr%, IntDate%
  6644.  
  6645. IntDate%     date compressed into an integer
  6646. -------
  6647. MonthNr%     month number (1-12)
  6648. DayNr%       day (1-31)
  6649. YearNr%      year (1980-2079; see above for two-digit years)
  6650.  
  6651. Name  : Int2DateSt$          (Integer to Date String)
  6652. Class : Time
  6653. Level : Any
  6654.  
  6655. This routine undoes the results of the Date2Int routine.  It
  6656. expands a single integer into a date string with the format
  6657. MM-DD-YYYY.
  6658.  
  6659. The storage format is identical to that used by DOS for file
  6660. dates, by the way, so this routine makes an apt companion for
  6661. LoadDirFull.
  6662.  
  6663. See also Int2Date, a version of this routine which returns
  6664. month, day, and year numbers instead of a string.
  6665.  
  6666.  
  6667.    DateSt$ = Int2DateSt$(IntDate%)
  6668.  
  6669. IntDate%     date compressed into an integer
  6670. -------
  6671. DateSt$      uncompressed date in MM-DD-YYYY format.
  6672.  
  6673. Name  : Int2Time             (Integer to Time)
  6674. Class : Time
  6675. Level : Any
  6676.  
  6677. This routine undoes the results of the Time2Int routine.  It
  6678. expands a single integer into hour, minute, and second values.
  6679.  
  6680. Note that the seconds will always be even, due to the storage
  6681. format.  The storage format is identical to that used by DOS
  6682. for file times, by the way, so this routine makes an apt
  6683. companion for LoadDirFull.
  6684.  
  6685. See also Int2TimeSt$, a version of this routine which returns a
  6686. string instead of numbers.
  6687.  
  6688.    Int2Time HourNr%, MinuteNr%, SecondNr%, IntTime%
  6689.  
  6690. IntTime%     time compressed into an integer
  6691. -------
  6692. HourNr%      hour (0-23)
  6693. MinuteNr%    minute
  6694. SecondNr%    second
  6695.  
  6696. Name  : Int2TimeSt$          (Integer to Time String)
  6697. Class : Time
  6698. Level : Any
  6699.  
  6700. This routine undoes the results of the Time2Int routine.  It
  6701. expands a single integer into hour, minute, and second values.
  6702.  
  6703. Note that the seconds will always be even, due to the storage
  6704. format.  The storage format is identical to that used by DOS
  6705. for file times, by the way, so this routine makes an apt
  6706. companion for LoadDirFull.
  6707.  
  6708. See also Int2Time, a version of this routine which returns
  6709. hour, minute, and second numbers instead of a string.
  6710.  
  6711.    TimeSt$ = Int2TimeSt$(IntTime%)
  6712.  
  6713. IntTime%     time compressed into an integer
  6714. -------
  6715. TimeSt$      uncompressed time in HH:MM:SS format
  6716.  
  6717. Name  : IntVector            (Interrupt Vector)
  6718. Class : Miscellaneous
  6719. Level : DOS
  6720.  
  6721. The IntVector routine retrieves the address of a specified
  6722. interrupt handler. If there is no interrupt handler, the
  6723. results will normally be zero, although early DOS versions did
  6724. not always have the sense to initialize unused vectors that way.
  6725.  
  6726.    IntVector DSeg%, DOfs%, Interrupt%
  6727.  
  6728. Interrupt%   interrupt number to examine
  6729. -------
  6730. DSeg%        segment of the interrupt handler
  6731. DOfs%        offset of the interrupt handler
  6732.  
  6733. Name  : IRead                (Integer Read)
  6734. Class : Disk
  6735. Level : DOS
  6736.  
  6737. This routine reads an integer (two binary bytes) from a file.
  6738. For some applications, you might prefer LIRead, which reads an
  6739. integer from a file into a zero-extended long integer-- which
  6740. essentially provides support for unsigned integers (0-65535).
  6741.  
  6742. The file must have been opened using FCreate or FOpen1.
  6743.  
  6744.    IRead Handle%, Value%, ErrCode%
  6745.  
  6746. Handle%    file handle
  6747. -------
  6748. Value%     integer read from file
  6749. ErrCode%   DOS error code (0 if no error)
  6750.  
  6751. Name  : IsAlNum%             (Is Alphanumeric?)
  6752. Class : String
  6753. Level : Any
  6754.  
  6755. This function returns whether a character is alphabetic or
  6756. numeric.
  6757.  
  6758. Functions in this family include:
  6759.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6760.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6761.  
  6762.    IsIt% = IsAlNum%(Ch$)
  6763.  
  6764. Ch$       character to check
  6765. -------
  6766. IsIt%     -1 if the character is alphabetic or numeric
  6767.  
  6768. Name  : IsAlpha%             (Is Alphabetic?)
  6769. Class : String
  6770. Level : Any
  6771.  
  6772. This function returns whether a character is alphabetic.
  6773.  
  6774. Functions in this family include:
  6775.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6776.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6777.  
  6778.    IsIt% = IsAlpha%(Ch$)
  6779.  
  6780. Ch$       character to check
  6781. -------
  6782. IsIt%     -1 if the character is alphabetic
  6783.  
  6784. Name  : IsASCII%             (Is ASCII?)
  6785. Class : String
  6786. Level : Any
  6787.  
  6788. This function returns whether a character is ASCII.  This is
  6789. true if the character ranges from CHR$(0)-CHR$(127).
  6790.  
  6791. Functions in this family include:
  6792.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6793.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6794.  
  6795.    IsIt% = IsASCII%(Ch$)
  6796.  
  6797. Ch$       character to check
  6798. -------
  6799. IsIt%     -1 if the character is ASCII
  6800.  
  6801. Name  : IsCntrl%             (Is Control?)
  6802. Class : String
  6803. Level : Any
  6804.  
  6805. This function returns whether a character is a control code.
  6806. This is true for CHR$(0)-CHR$(32) and CHR$(127).
  6807.  
  6808. Functions in this family include:
  6809.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6810.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6811.  
  6812.    IsIt% = IsCntrl%(Ch$)
  6813.  
  6814. Ch$       character to check
  6815. -------
  6816. IsIt%     -1 if the character is a control code
  6817.  
  6818. Name  : IsDigit%             (Is Digit?)
  6819. Class : String
  6820. Level : Any
  6821.  
  6822. This function returns whether a character is numeric.
  6823.  
  6824. Functions in this family include:
  6825.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6826.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6827.  
  6828.    IsIt% = IsDigit%(Ch$)
  6829.  
  6830. Ch$       character to check
  6831. -------
  6832. IsIt%     -1 if the character is a digit
  6833.  
  6834. Name  : IsLower%             (Is Lowercase?)
  6835. Class : String
  6836. Level : Any
  6837.  
  6838. This function returns whether a character is a lowercase
  6839. letter.
  6840.  
  6841. Functions in this family include:
  6842.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6843.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6844.  
  6845.    IsIt% = IsLower%(Ch$)
  6846.  
  6847. Ch$       character to check
  6848. -------
  6849. IsIt%     -1 if the character is a lowercase letter
  6850.  
  6851. Name  : IsPrint%             (Is Printable?)
  6852. Class : String
  6853. Level : Any
  6854.  
  6855. This function returns whether a character is printable.  This
  6856. is true for CHR$(32)-CHR$(126).
  6857.  
  6858. Functions in this family include:
  6859.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6860.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6861.  
  6862.    IsIt% = IsPrint%(Ch$)
  6863.  
  6864. Ch$       character to check
  6865. -------
  6866. IsIt%     -1 if the character is printable
  6867.  
  6868. Name  : IsPunct%             (Is Punctuation?)
  6869. Class : String
  6870. Level : Any
  6871.  
  6872. This function returns whether a character is punctuation.  This
  6873. is true for any ASCII character that is not alphabetic,
  6874. numeric, or a control code.
  6875.  
  6876. Functions in this family include:
  6877.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6878.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6879.  
  6880.    IsIt% = IsPunct%(Ch$)
  6881.  
  6882. Ch$       character to check
  6883. -------
  6884. IsIt%     -1 if the character is punctuation
  6885.  
  6886. Name  : IsSpace%             (Is Space?)
  6887. Class : String
  6888. Level : Any
  6889.  
  6890. This function returns whether a character is white space.  This
  6891. includes Space, Carriage Return, Horizontal Tab, Vertical Tab,
  6892. LineFeed, and FormFeed characters.
  6893.  
  6894. Functions in this family include:
  6895.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6896.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6897.  
  6898.    IsIt% = IsSpace%(Ch$)
  6899.  
  6900. Ch$       character to check
  6901. -------
  6902. IsIt%     -1 if the character is white space
  6903.  
  6904. Name  : IStr$                (Integer STR$)
  6905. Class : String
  6906. Level : Any
  6907.  
  6908. This function is identical to the BASIC function STR$, but is
  6909. somewhat smaller.  It is only for integer values.
  6910.  
  6911. If you prefer not to have a leading blank for non-negative
  6912. numbers, use the IStrNB$ function instead.
  6913.  
  6914.    St$ = IStr$(Number%)
  6915.  
  6916. Number%   integer to convert
  6917. -------
  6918. St$       string form of the number
  6919.  
  6920. Name  : IStrNB$              (Integer STR$, No Blank)
  6921. Class : String
  6922. Level : Any
  6923.  
  6924. This function is similar to the BASIC function STR$, but is
  6925. somewhat smaller.  It is only for integer values.  Unlike the
  6926. STR$ function, this function does not add a leading blank to
  6927. non-negative numbers.
  6928.  
  6929. If you prefer to have a leading blank for non-negative numbers,
  6930. use the IStr$ function instead.
  6931.  
  6932.    St$ = IStrNB$(Number%)
  6933.  
  6934. Number%   integer to convert
  6935. -------
  6936. St$       string form of the number
  6937.  
  6938. Name  : IsUpper%             (Is Uppercase?)
  6939. Class : String
  6940. Level : Any
  6941.  
  6942. This function returns whether a character is an uppercase
  6943. letter.
  6944.  
  6945. Functions in this family include:
  6946.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6947.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6948.  
  6949.    IsIt% = IsUpper%(Ch$)
  6950.  
  6951. Ch$       character to check
  6952. -------
  6953. IsIt%     -1 if the character is uppercase
  6954.  
  6955. Name  : IsXDigit%            (Is Hex Digit?)
  6956. Class : String
  6957. Level : Any
  6958.  
  6959. Functions in this family include:
  6960.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6961.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6962.  
  6963. This function returns whether a character is a hexadecimal
  6964. digit.
  6965.  
  6966.    IsIt% = IsXDigit%(Ch$)
  6967.  
  6968. Ch$       character to check
  6969. -------
  6970. IsIt%     -1 if the character is a hex digit
  6971.  
  6972. Name  : IVal%                (Integer VAL)
  6973. Class : Numeric
  6974. Level : Any
  6975.  
  6976. This routine is similar to the BASIC function VAL, but is much
  6977. faster.  If you are not using floating point numbers, this
  6978. routine may also decrease the size of your program
  6979. significantly, since it won't cause BASIC to pull in its
  6980. floating point routines as VAL does.
  6981.  
  6982. Unlike VAL, this routine only converts strings to integer
  6983. values.  It will not handle hex or octal strings.  It will not
  6984. notify you if there is an overflow error.  Finally, although
  6985. IVal% will ignore leading blanks, it assumes that a number may
  6986. not contain blanks, whereas VAL will ignore blanks in the
  6987. middle of a number:
  6988.  
  6989.      VAL("  12 34") returns 1234
  6990.    IVal%("  12 34") returns 12
  6991.  
  6992. Note that, like VAL (but unlike the IVal% function in ProBas),
  6993. multiple negation is considered illegal.  For example,
  6994. IVal%("--1") returns zero.
  6995.  
  6996.    Number% = IVal%(St$)
  6997.  
  6998. St$       string to convert
  6999. -------
  7000. Number%   integer form of string (0 if there isn't one)
  7001.  
  7002. Name  : IWrite               (Integer Write)
  7003. Class : Disk
  7004. Level : DOS
  7005.  
  7006. This routine writes an integer (two binary bytes) to a file.
  7007.  
  7008. The file must have been opened using FCreate or FOpen1.
  7009.  
  7010.    IWrite Handle%, Value%, ErrCode%
  7011.  
  7012. Handle%    file handle
  7013. Value%     integer to write to file
  7014. -------
  7015. ErrCode%   DOS error code (0 if no error)
  7016.  
  7017. Name  : KbdType              (Keyboard Type)
  7018. Class : Input / Equipment
  7019. Level : Clone
  7020.  
  7021. This routine tells you if an enhanced (101-key) keyboard is
  7022. available.
  7023.  
  7024. If KbdType is not entirely sure that an enhanced keyboard is
  7025. available, it plays safe and assumes there isn't one.  This
  7026. avoids possible disaster on older PCs.
  7027.  
  7028.    KbdType Enhanced%
  7029.  
  7030. -------
  7031. Enhanced%    whether keyboard is of the enhanced type (0 no)
  7032.  
  7033. Name  : KbdType2%            (Keyboard Type)
  7034. Class : Input / Equipment
  7035. Level : Clone
  7036.  
  7037. This routine tells you if an enhanced (101-key) keyboard is
  7038. available.
  7039.  
  7040. If KbdType2% is not entirely sure that an enhanced keyboard is
  7041. available, it plays safe and assumes there isn't one.  This
  7042. avoids possible disaster on older PCs.
  7043.  
  7044.    Enhanced% = KbdType2%
  7045.  
  7046. -------
  7047. Enhanced%    whether keyboard is of the enhanced type (0 no)
  7048.  
  7049. Name  : KeyPress             (detect Key Press)
  7050. Class : Input
  7051. Level : DOS
  7052.  
  7053. This routine works like the Turbo/Power BASIC function INSTAT.
  7054. It tells you whether there is a key waiting to be processed.
  7055.  
  7056.    KeyPress KeyHit%
  7057.  
  7058. -------
  7059. KeyHit%   whether a key is waiting (0 if no)
  7060.  
  7061. Name  : KVal&                (Kilobyte VAL)
  7062. Class : Numeric
  7063. Level : Any
  7064.  
  7065. This routine is similar to the BASIC function VAL, but is much
  7066. faster.  The number returned is divided by 1024, which is
  7067. useful if you're dealing in terms of kilobytes.  If you are not
  7068. using floating point numbers, this routine may decrease the
  7069. size of your program significantly, since it won't cause BASIC
  7070. to pull in its floating point routines as VAL does.
  7071.  
  7072. Unlike VAL, this routine only converts strings to long integer
  7073. values.  It will not handle hex or octal strings.  It will not
  7074. notify you if there is an overflow error.  Finally, although
  7075. KVal& will ignore leading blanks, it assumes that a number may
  7076. not contain blanks, whereas VAL will ignore blanks in the
  7077. middle of a number.
  7078.  
  7079. Note that, like VAL (but unlike the KVal& function in ProBas),
  7080. multiple negation is considered illegal.  For example,
  7081. KVal&("--10000") returns zero.
  7082.  
  7083.    Number& = KVal&(St$)
  7084.  
  7085. St$       string to convert
  7086. -------
  7087. Number&   long integer form of string, divided by 1024
  7088.  
  7089. Name  : LClose               (L/I/M Close)
  7090. Class : Memory
  7091. Level : BIOS
  7092.  
  7093. This routine closes a block of expanded memory that was opened
  7094. for access by LOpen.  It is important to close the block when
  7095. you are finished with it, to return it to the free memory pool.
  7096.  
  7097. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7098.  
  7099.    LClose EMSHandle%
  7100.  
  7101. EMSHandle%    handle of the expanded memory block
  7102.  
  7103. Name  : LGet                 (L/I/M Get)
  7104. Class : Memory
  7105. Level : BIOS
  7106.  
  7107. This routine gets a block of data from expanded memory that was
  7108. opened for access by LOpen.  The amount of data is specified in
  7109. words; one word is the same as two bytes.  An integer takes up
  7110. a word, long integers and single precision numbers require two
  7111. words, and double precision numbers take four.
  7112.  
  7113. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7114.  
  7115.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  7116.  
  7117. EMSHandle%    handle of the expanded memory block
  7118. DSeg%         segment of place to store data
  7119. DOfs%         offset of place to store data
  7120. Words%        words to get from expanded memory
  7121.  
  7122. Name  : LIRead               (Long Integer Read)
  7123. Class : Disk
  7124. Level : DOS
  7125.  
  7126. This routine reads an integer from a file into a long integer.
  7127. The integer is zero-extended into the long, providing effective
  7128. support for unsigned integers (a range of 0-65535).
  7129.  
  7130. The file must have been opened using FCreate or FOpen1.
  7131.  
  7132.    LIRead Handle%, Value&, ErrCode%
  7133.  
  7134. Handle%    file handle
  7135. -------
  7136. Value&     integer read from file
  7137. ErrCode%   DOS error code (0 if no error)
  7138.  
  7139. Name  : LIWrite              (Long Integer Write)
  7140. Class : Disk
  7141. Level : DOS
  7142.  
  7143. This routine writes an integer to a file from a long integer.
  7144. This makes it easier to support unsigned integers (with a range
  7145. of 0-65535).
  7146.  
  7147. The file must have been opened using FCreate or FOpen1.
  7148.  
  7149.    LIWrite Handle%, Value&, ErrCode%
  7150.  
  7151. Handle%    file handle
  7152. Value&     integer to write to file
  7153. -------
  7154. ErrCode%   DOS error code (0 if no error)
  7155.  
  7156. Name  : LoadDir              (Load Directory)
  7157. Class : Disk
  7158. Level : DOS
  7159.  
  7160. Given a filespec with wildcards and a file attribute, this
  7161. routine loads a list of all matching files into an array.  The
  7162. array must be of fixed-length string type, with 12 characters
  7163. for each filename.  You can find out how large to DIM the array
  7164. by using the FileCount routine.
  7165.  
  7166. The attribute can be any of the usual file attributes:
  7167.    1   Read-Only
  7168.    2   Hidden
  7169.    4   System
  7170.   16   Directory
  7171.  
  7172. You can combine attributes by adding their values.  For
  7173. instance, to search for hidden directories, you'd use an
  7174. attribute of 18.  By default, DOS returns normal files as well
  7175. as files which have the specified attributes, so an attribute
  7176. of 18 would get you normal files, hidden files, directories,
  7177. and hidden directories.  However, LoadDir can be made to screen
  7178. out unwanted files-- just negate the attribute to force only
  7179. files of that attribute to be counted.  For example, an
  7180. attribute of -18 would return only hidden subdirectories.
  7181.  
  7182. NOTE:  we use FilAttr%, not FileAttr%, because BASIC has an
  7183. internal function named FILEATTR.
  7184.  
  7185.    LoadDir FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  7186.  
  7187. FileSpec$    search file specification (may contain wildcards)
  7188. FilAttr%     search file attribute
  7189. DSeg%        segment of array (use VARSEG)
  7190. DOfs%        offset of array (use VARPTR)
  7191. -------
  7192. ErrCode%     error code (0 if no error)
  7193.  
  7194. Name  : LoadDirAll           (Load Directory, All info)
  7195. Class : Disk
  7196. Level : DOS
  7197.  
  7198. Given a filespec with wildcards and a file attribute, this
  7199. routine loads a list of all matching files into an array.  All
  7200. available information about the file is included: name, size,
  7201. time, date, and attribute.  The array must be of the TYPE shown
  7202. below.  You can find out how large to DIM the array by using
  7203. the FileCount routine.
  7204.  
  7205.    TYPE DirType
  7206.       FilAttr AS STRING * 1
  7207.       FilTime AS INTEGER
  7208.       FilDate AS INTEGER
  7209.       FilSize AS LONG
  7210.       FilName AS STRING * 12
  7211.    END TYPE
  7212.  
  7213. You can change the names if you like, but don't alter the order
  7214. of the information.  You can decode the file attribute with the
  7215. ASC function, then process it with ExplainFAttr$.  The file
  7216. time and date can be decoded with the Int2Time and Int2Date or
  7217. Int2TimeSt$ and Int2DateSt$ routines.
  7218.  
  7219. The attribute can be any of the usual file attributes:
  7220.    1   Read-Only
  7221.    2   Hidden
  7222.    4   System
  7223.   16   Directory
  7224.  
  7225. You can combine attributes by adding their values.  For
  7226. instance, to search for hidden directories, you'd use an
  7227. attribute of 18.  By default, DOS returns normal files as well
  7228. as files which have the specified attributes, so an attribute
  7229. of 18 would get you normal files, hidden files, directories,
  7230. and hidden directories.  However, LoadDir can be made to screen
  7231. out unwanted files-- just negate the attribute to force only
  7232. files of that attribute to be counted.  For example, an
  7233. attribute of -18 would return only hidden subdirectories.
  7234.  
  7235. NOTE:  we use FilAttr%, not FileAttr%, because BASIC has an
  7236. internal function named FILEATTR.
  7237.  
  7238.    LoadDir FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  7239.  
  7240. FileSpec$    search file specification (may contain wildcards)
  7241. FilAttr%     search file attribute
  7242. DSeg%        segment of array (use VARSEG)
  7243. DOfs%        offset of array (use VARPTR)
  7244. -------
  7245. ErrCode%     error code (0 if no error)
  7246.  
  7247. Name  : LoByte%              (Low Byte)
  7248. Class : Numeric
  7249. Level : Any
  7250.  
  7251. This function returns the low byte of an integer.
  7252.  
  7253.    Byte% = LoByte%(Nr%)
  7254.  
  7255. Nr%        integer
  7256. -------
  7257. Byte%      value of the least significant byte
  7258.  
  7259. Name  : Locase               (Lowercase)
  7260. Class : String
  7261. Level : Any
  7262.  
  7263. This routine, like BASIC's LCASE$ function, converts a string
  7264. to lowercase. Since it doesn't have to create a new return
  7265. string (a fairly slow process), it's faster than the BASIC
  7266. equivalent.
  7267.  
  7268. See also Locase1.
  7269.  
  7270.    Locase St$
  7271.  
  7272. St$     string to be put into lowercase
  7273. -------
  7274. St$     lowercase string
  7275.  
  7276. Name  : Locase1              (Lowercase)
  7277. Class : String
  7278. Level : Any
  7279.  
  7280. This routine, like BASIC's LCASE$ function, converts a string
  7281. to lowercase. It converts letters in the extended character set
  7282. as well as the usual letters, making it well suited for text
  7283. which may not be in English.
  7284.  
  7285. Note that DOS 5.0 and later versions provide National Language
  7286. Support which includes conversion to uppercase (not lowercase,
  7287. unfortunately).  So, if you merely need the characters in a
  7288. known state, rather than lowercase, you would do better to use
  7289. the Upcase1 routine.  Locase1 assumes the U.S. character set,
  7290. which may well not be appropriate.
  7291.  
  7292. See also Locase.
  7293.  
  7294.    Locase1 St$
  7295.  
  7296. St$     string to be put into lowercase
  7297. -------
  7298. St$     lowercase string
  7299.  
  7300. Name  : LogicalDrives%       (Logical Drives)
  7301. Class : Disk / Equipment
  7302. Level : DOS
  7303.  
  7304. This function returns the number of logical drives available.
  7305.  
  7306. A logical drive corresponds roughly to a drive letter-- it may
  7307. point to zero or more actual devices.  For instance, on a
  7308. one-floppy system, both A: and B: point to the same drive.  On
  7309. a partitioned hard drive, both C: and D: may point to different
  7310. areas of the same drive.  Drive E: may point to a RAMdisk, or
  7311. maybe it doesn't point to anything at all.
  7312.  
  7313. As you can see, knowing the number of logical drives doesn't
  7314. tell you much about what's actually there.  However, it does
  7315. give you an upper limit on the number of drive letters
  7316. available, which is a good place to start.
  7317.  
  7318.    Drives% = LogicalDrives%
  7319.  
  7320. -------
  7321. Drives%    number of logical drives
  7322.  
  7323. Name  : LOpen                (L/I/M Open)
  7324. Class : Memory
  7325. Level : BIOS
  7326.  
  7327. This routine opens a block of expanded memory for access.  The
  7328. size of the block is specified in words; one word is the same
  7329. as two bytes.  An integer takes up a word, long integers and
  7330. single precision numbers require two words, and double
  7331. precision numbers take four.  This allows you to store up to
  7332. 64K in each EMS block that you open.
  7333.  
  7334. Note that LOpen expects an EMS driver to be available.  If you
  7335. are not certain on this point, use GetLIMM beforehand to make
  7336. sure.
  7337.  
  7338. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7339.  
  7340.    LOpen Words%, EMSHandle%, ErrCode%
  7341.  
  7342. Words%        size of expanded memory block to allocate
  7343. -------
  7344. EMSHandle%    handle of the expanded memory block
  7345. ErrCode%      error code (0 if no error)
  7346.  
  7347. Name  : LoWord%              (Low Word)
  7348. Class : Numeric
  7349. Level : Any
  7350.  
  7351. This function returns the low word of a long integer.
  7352.  
  7353.    Word% = LoWord%(Nr&)
  7354.  
  7355. Nr&        long integer
  7356. -------
  7357. Word%      value of the least significant word
  7358.  
  7359. Name  : LPut                 (L/I/M Put)
  7360. Class : Memory
  7361. Level : BIOS
  7362.  
  7363. This routine puts a block of data into expanded memory that was
  7364. opened for access by LOpen.  The amount of data is specified in
  7365. words; one word is the same as two bytes.  An integer takes up
  7366. a word, long integers and single precision numbers require two
  7367. words, and double precision numbers take four.
  7368.  
  7369. Routines in this suite include: LOpen, LGet, LPut, LClose.
  7370.  
  7371.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  7372.  
  7373. EMSHandle%    handle of the expanded memory block
  7374. DSeg%         segment of place from which to get data
  7375. DOfs%         offset of place from which to get data
  7376. Words%        words to put into expanded memory
  7377.  
  7378. Name  : LRead                (Long Read)
  7379. Class : Disk
  7380. Level : DOS
  7381.  
  7382. This routine reads a long integer (four binary bytes) from a
  7383. file.
  7384.  
  7385. The file must have been opened using FCreate or FOpen1.
  7386.  
  7387.    LRead Handle%, Value&, ErrCode%
  7388.  
  7389. Handle%    file handle
  7390. -------
  7391. Value&     long integer read from file
  7392. ErrCode%   DOS error code (0 if no error)
  7393.  
  7394. Name  : LRotate              (Left Rotate string)
  7395. Class : String
  7396. Level : Any
  7397.  
  7398. Many years ago, I wrote one of the first terminal programs for
  7399. the PC.  It died a horrible death when Qmodem came out...
  7400. sigh.  This routine comes from that experience.  It rotates the
  7401. characters in a string left once (e.g., "ABCDE" becomes
  7402. "BCDEA").  I used this in my routine to dial a list of BBSes,
  7403. skipping to the next one if the current one was busy.
  7404.  
  7405. LRotate can also be handy for things like scrolling a long
  7406. message across the screen (you just PRINT LEFT$(Message$, 80);
  7407. then delay a bit, LRotate and do it again).
  7408.  
  7409. See also RRotate.
  7410.  
  7411.    LRotate St$
  7412.  
  7413. St$     string to be rotated left once
  7414. -------
  7415. St$     string after being rotated left once
  7416.  
  7417. Name  : LScroll              (Left Scroll)
  7418. Class : Display
  7419. Level : Clone
  7420.  
  7421. This routine scrolls any selected part of the display left.
  7422. You may scroll as many times as you like, or scroll "zero"
  7423. times to totally clear the selected part of the display.
  7424.  
  7425.    LScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  7426.  
  7427. TopRow%      top row of the area to scroll
  7428. LeftCol%     left column of the area to scroll
  7429. BottomRow%   top row of the area to scroll
  7430. RightCol%    left column of the area to scroll
  7431. Times%       number of times (or rows) to scroll
  7432.  
  7433. Name  : LVal&                (Long integer VAL)
  7434. Class : Numeric
  7435. Level : Any
  7436.  
  7437. This routine is similar to the BASIC function VAL, but is much
  7438. faster.  If you are not using floating point numbers, this
  7439. routine may also decrease the size of your program
  7440. significantly, since it won't cause BASIC to pull in its
  7441. floating point routines as VAL does.
  7442.  
  7443. Unlike VAL, this routine only converts strings to long integer
  7444. values.  It will not handle hex or octal strings.  It will not
  7445. notify you if there is an overflow error.  Finally, although
  7446. LVal& will ignore leading blanks, it assumes that a number may
  7447. not contain blanks, whereas VAL will ignore blanks in the
  7448. middle of a number:
  7449.  
  7450.      VAL("  12 34") returns 1234
  7451.    LVal&("  12 34") returns 12
  7452.  
  7453. Note that, like VAL (but unlike the LVal& function in ProBas),
  7454. multiple negation is considered illegal.  For example,
  7455. LVal&("--1") returns zero.
  7456.  
  7457.    Number& = LVal&(St$)
  7458.  
  7459. St$       string to convert
  7460. -------
  7461. Number&   long integer form of string (0 if there isn't one)
  7462.  
  7463. Name  : LWrite               (Long Write)
  7464. Class : Disk
  7465. Level : DOS
  7466.  
  7467. This routine writes a long integer to a file.
  7468.  
  7469. The file must have been opened using FCreate or FOpen1.
  7470.  
  7471.    LWrite Handle%, Value&, ErrCode%
  7472.  
  7473. Handle%    file handle
  7474. Value&     long integer to write to file
  7475. -------
  7476. ErrCode%   DOS error code (0 if no error)
  7477.  
  7478. Name  : MakeSub              (Make Subdirectory)
  7479. Class : Disk
  7480. Level : DOS
  7481.  
  7482. Like the DOS MD (or MKDIR) command, this routine creates a new
  7483. subdirectory.
  7484.  
  7485.    MakeSub SubDir$, ErrCode%
  7486.  
  7487. SubDir$    name of new subdirectory
  7488. -------
  7489. ErrCode%   error code: 0 if none, else DOS Error
  7490.  
  7491. Name  : MatchFile            (Match File)
  7492. Class : Disk / String
  7493. Level : Any
  7494.  
  7495. The MatchFile routine tells you whether a given filename
  7496. matches a file specification which may contain wildcards.  The
  7497. filename itself should not contain wildcards.  Neither the
  7498. filename nor filespec should include drive or subdirectory
  7499. specifications.
  7500.  
  7501. One way of using this is in processing file exclusion lists.
  7502. The FindFirstF routine allows you to find files that match a
  7503. given filespec; to this, you could add a MatchFile-based
  7504. routine which would screen out files that match a different
  7505. filespec.  Such a routine would allow you to create utilities
  7506. to do things like "DIR *.* /EXCEPT=*.BAS".
  7507.  
  7508.    MatchFile FileSpec$, FileName$, IsMatch%
  7509.  
  7510. FileSpec$   master file pattern (may contain wildcards)
  7511. FileName$   name of file to test against the master pattern
  7512. -------
  7513. IsMatch%    0 if the filename doesn't match the filespec
  7514.  
  7515. Name  : Max%                 (Maximum)
  7516. Class : Numeric
  7517. Level : Any
  7518.  
  7519. This function returns the larger of two integers.  It can be
  7520. handy in sorting routines or for keeping a value within a
  7521. desired range.
  7522.  
  7523.    Larger% = Max%(First%, Second%)
  7524.  
  7525. First%     one integer
  7526. Second%    another integer
  7527. -------
  7528. Larger%    larger of the two integers
  7529.  
  7530. Name  : MaxD#                (Maximum Double precision)
  7531. Class : Numeric
  7532. Level : Any
  7533.  
  7534. This function returns the larger of two double-precision
  7535. numbers.  It can be handy in sorting routines or for keeping a
  7536. value within a desired range.
  7537.  
  7538.    Larger# = MaxD#(First#, Second#)
  7539.  
  7540. First#     one number
  7541. Second#    another number
  7542. -------
  7543. Larger#    larger of the two numbers
  7544.  
  7545. Name  : MaxL&                (Maximum Long integer)
  7546. Class : Numeric
  7547. Level : Any
  7548.  
  7549. This function returns the larger of two long integers.  It can
  7550. be handy in sorting routines or for keeping a value within a
  7551. desired range.
  7552.  
  7553.    Larger& = MaxL&(First&, Second&)
  7554.  
  7555. First&     one long integer
  7556. Second&    another long integer
  7557. -------
  7558. Larger&    larger of the two long integers
  7559.  
  7560. Name  : MaxS!                (Maximum Single precision)
  7561. Class : Numeric
  7562. Level : Any
  7563.  
  7564. This function returns the larger of two single-precision
  7565. numbers.  It can be handy in sorting routines or for keeping a
  7566. value within a desired range.
  7567.  
  7568.    Larger! = MaxS!(First!, Second!)
  7569.  
  7570. First!     one number
  7571. Second!    another number
  7572. -------
  7573. Larger!    larger of the two numbers
  7574.  
  7575. Name  : MeanAverageD         (Mean Average Double precision)
  7576. Class : Array management
  7577. Level : Any
  7578.  
  7579. This routine averages the specified range of elements in an
  7580. array of double precision numbers.  The form of averaging used
  7581. is called the "mean", which is the sum of all of the elements
  7582. divided by the number of elements involved. This is the most
  7583. common method of averaging a list of numbers.
  7584.  
  7585.    MeanAverageD Array#(), First%, Last%, Average#, ErrCode%
  7586.  
  7587. Array#()    array to be averaged
  7588. First%      array element to start with
  7589. Last%       array element to end with
  7590. -------
  7591. Average#    average value of the specified elements
  7592. ErrCode%    0 if there was no error
  7593.  
  7594. Name  : MeanAverageI         (Mean Average Integer)
  7595. Class : Array management
  7596. Level : Any
  7597.  
  7598. This routine averages the specified range of elements in an
  7599. array of integer numbers.  The form of averaging used is called
  7600. the "mean", which is the sum of all of the elements divided by
  7601. the number of elements involved. This is the most common method
  7602. of averaging a list of numbers.
  7603.  
  7604.    MeanAverageI Array%(), First%, Last%, Average%, ErrCode%
  7605.  
  7606. Array()     array to be averaged
  7607. First%      array element to start with
  7608. Last%       array element to end with
  7609. -------
  7610. Average%    average value of the specified elements
  7611. ErrCode%    0 if there was no error
  7612.  
  7613. Name  : MeanAverageL         (Mean Average Long integer)
  7614. Class : Array management
  7615. Level : Any
  7616.  
  7617. This routine averages the specified range of elements in an
  7618. array of long integer numbers.  The form of averaging used is
  7619. called the "mean", which is the sum of all of the elements
  7620. divided by the number of elements involved. This is the most
  7621. common method of averaging a list of numbers.
  7622.  
  7623.    MeanAverageL Array&(), First%, Last%, Average&, ErrCode%
  7624.  
  7625. Array&()    array to be averaged
  7626. First%      array element to start with
  7627. Last%       array element to end with
  7628. -------
  7629. Average&    average value of the specified elements
  7630. ErrCode%    0 if there was no error
  7631.  
  7632. Name  : MeanAverageS         (Mean Average Single precision)
  7633. Class : Array management
  7634. Level : Any
  7635.  
  7636. This routine averages the specified range of elements in an
  7637. array of single precision numbers.  The form of averaging used
  7638. is called the "mean", which is the sum of all of the elements
  7639. divided by the number of elements involved. This is the most
  7640. common method of averaging a list of numbers.
  7641.  
  7642.    MeanAverageS Array!(), First%, Last%, Average!, ErrCode%
  7643.  
  7644. Array!()    array to be averaged
  7645. First%      array element to start with
  7646. Last%       array element to end with
  7647. -------
  7648. Average!    average value of the specified elements
  7649. ErrCode%    0 if no error
  7650.  
  7651. Name  : MemSwap              (Memory Swap)
  7652. Class : Memory
  7653. Level : Any
  7654.  
  7655. MemSwap swaps the contents of one area of memory with another.
  7656. This can be used for a variety of things, from swapping a saved
  7657. screen with the actual screen to exchanging the contents of two
  7658. arrays.
  7659.  
  7660.    MemSwap DSeg1%, DOfs1%, DSeg2%, DOfs2%, Bytes%
  7661.  
  7662. DSeg1%     segment of first memory area
  7663. DOfs1%     offset of first memory area
  7664. DSeg2%     segment of second memory area
  7665. DOfs2%     offset of second memory area
  7666. Bytes%     bytes to swap
  7667.  
  7668. Name  : Min%                 (Minimum)
  7669. Class : Numeric
  7670. Level : Any
  7671.  
  7672. This function returns the smaller of two integers.  It can be
  7673. handy in sorting routines or for keeping a value within a
  7674. desired range.
  7675.  
  7676.    Smaller% = Min%(First%, Second%)
  7677.  
  7678. First%     one integer
  7679. Second%    another integer
  7680. -------
  7681. Smaller%   smaller of the two integers
  7682.  
  7683. Name  : MinD#                (Minimum Double precision)
  7684. Class : Numeric
  7685. Level : Any
  7686.  
  7687. This function returns the smaller of two double-precision
  7688. numbers.  It can be handy in sorting routines or for keeping a
  7689. value within a desired range.
  7690.  
  7691.    Smaller# = MinD#(First#, Second#)
  7692.  
  7693. First#     one number
  7694. Second#    another number
  7695. -------
  7696. Smaller#   smaller of the two numbers
  7697.  
  7698. Name  : MinL&                (Minimum Long integer)
  7699. Class : Numeric
  7700. Level : Any
  7701.  
  7702. This function returns the smaller of two long integers.  It can
  7703. be handy in sorting routines or for keeping a value within a
  7704. desired range.
  7705.  
  7706.    Smaller& = MinL&(First&, Second&)
  7707.  
  7708. First&     one long integer
  7709. Second&    another long integer
  7710. -------
  7711. Smaller&   smaller of the two long integers
  7712.  
  7713. Name  : MinS!                (Minimum Single precision)
  7714. Class : Numeric
  7715. Level : Any
  7716.  
  7717. This function returns the smaller of two single-precision
  7718. numbers.  It can be handy in sorting routines or for keeping a
  7719. value within a desired range.
  7720.  
  7721.    Smaller! = MinS!(First!, Second!)
  7722.  
  7723. First!     one number
  7724. Second!    another number
  7725. -------
  7726. Smaller!   smaller of the two numbers
  7727.  
  7728. Name  : MMButton             (Mouse Button)
  7729. Class : Mouse
  7730. Level : BIOS
  7731.  
  7732. The MMButton routine allows you to find out which mouse buttons
  7733. are pressed. Although it will work with any mouse, it is
  7734. designed specifically for a mouse with two buttons (see also
  7735. MMButton3).  If you want to find out which buttons were pressed
  7736. in the past, rather than being pressed now, try MMClick instead.
  7737.  
  7738. This routine will not work properly if there is no mouse
  7739. available.  Use the MMCheck routine if you are not sure.
  7740.  
  7741.    MMButton LeftB%, RightB%
  7742.  
  7743. -------
  7744. LeftB%     whether the left button is pressed
  7745. RightB%    whether the right button is pressed
  7746.  
  7747. Name  : MMButton3            (Mouse Button for 3-button mouse)
  7748. Class : Mouse
  7749. Level : BIOS
  7750.  
  7751. The MMButton3 routine allows you to find out which mouse
  7752. buttons are pressed. Although it will work with any mouse, it
  7753. is designed specifically for a mouse with three buttons (see
  7754. also MMButton).  If you want to find out which buttons were
  7755. pressed in the past, rather than being pressed now, try
  7756. MMClick3 instead.
  7757.  
  7758. This routine will not work properly if there is no mouse
  7759. available.  Use the MMCheck routine if you are not sure.
  7760.  
  7761.    MMButton3 LeftB%, MiddleB%, RightB%
  7762.  
  7763. -------
  7764. LeftB%     whether the left button is pressed
  7765. MiddleB%   whether the middle button is pressed
  7766. RightB%    whether the right button is pressed
  7767.  
  7768. Name  : MMCheck              (Mouse Check and initialize)
  7769. Class : Mouse
  7770. Level : BIOS
  7771.  
  7772. This routine does a number of things.  Primarily, it is
  7773. intended to let you check to see if a mouse is available.  It
  7774. returns a zero if there is no mouse; if there is a mouse, the
  7775. number of mouse buttons is returned.  The mouse status is also
  7776. initialized, so this is best used once at the beginning of your
  7777. program.
  7778.  
  7779. All of the other mouse routines assume that a mouse is
  7780. available, so you should definitely use MMCheck if you're not
  7781. sure.  Otherwise, results will be unusual at best, and the
  7782. computer may even lock up under some DOS versions.
  7783.  
  7784. There is also a function version of this routine, MMCheck2%.
  7785.  
  7786.    MMCheck Buttons%
  7787.  
  7788. -------
  7789. Buttons%   number of mouse buttons (0 if no mouse is installed)
  7790.  
  7791. Name  : MMCheck2%            (Mouse Check and initialize)
  7792. Class : Mouse
  7793. Level : BIOS
  7794.  
  7795. This function does a number of things.  Primarily, it is
  7796. intended to let you check to see if a mouse is available.  It
  7797. returns a zero if there is no mouse; if there is a mouse, the
  7798. number of mouse buttons is returned.  The mouse status is also
  7799. initialized, so this is best used once at the beginning of your
  7800. program.
  7801.  
  7802. All of the other mouse routines assume that a mouse is
  7803. available, so you should definitely use MMCheck2% if you're not
  7804. sure.  Otherwise, results will be unusual at best, and the
  7805. computer may even lock up under some DOS versions.
  7806.  
  7807. There is also a sub version of this routine, MMCheck.
  7808.  
  7809.    Buttons% = MMCheck2%
  7810.  
  7811. -------
  7812. Buttons%   number of mouse buttons (0 if no mouse is installed)
  7813.  
  7814. Name  : MMClick              (Mouse Click)
  7815. Class : Mouse
  7816. Level : BIOS
  7817.  
  7818. The MMClick routine allows you to find out which mouse buttons
  7819. have been pressed since you last checked, and how many times
  7820. they were pressed. Although it will work with any mouse, it is
  7821. designed specifically for a mouse with two buttons (see also
  7822. MMClick3).  If you want to find out which buttons are currently
  7823. being pressed, try MMButton instead.
  7824.  
  7825. This routine will not work properly if there is no mouse
  7826. available.  Use the MMCheck routine if you are not sure.
  7827.  
  7828.    MMClick LeftB%, RightB%
  7829.  
  7830. -------
  7831. LeftB%     # of times left button was pressed since last check
  7832. RightB%    # of times right button was pressed since last check
  7833.  
  7834. Name  : MMClick3             (Mouse Click for 3-button mouse)
  7835. Class : Mouse
  7836. Level : BIOS
  7837.  
  7838. The MMClick3 routine allows you to find out which mouse buttons
  7839. have been pressed since you last checked, and how many times
  7840. they were pressed. Although it will work with any mouse, it is
  7841. designed specifically for a mouse with three buttons (see also
  7842. MMClick).  If you want to find out which buttons are currently
  7843. being pressed, try MMButton3 instead.
  7844.  
  7845. This routine will not work properly if there is no mouse
  7846. available.  Use the MMCheck routine if you are not sure.
  7847.  
  7848.    MMClick3 LeftB%, MiddleB%, RightB%
  7849.  
  7850. -------
  7851. LeftB%     # of times left button was pressed since last check
  7852. MiddleB%   # of times middle button was pressed since last look
  7853. RightB%    # of times right button was pressed since last check
  7854.  
  7855. Name  : MMCursorOff          (Mouse Cursor Off)
  7856. Class : Mouse
  7857. Level : BIOS
  7858.  
  7859. This routine makes the mouse cursor invisible.  The mouse
  7860. cursor will still function as a location indicator, in the same
  7861. way that the normal cursor still functions when you make it
  7862. invisible.
  7863.  
  7864. Note that the mouse cursor is somewhat bizarre in that an
  7865. "invisibility level" is kept.  Every time you use MMCursorOff,
  7866. the invisibility depth is increased; subsequent attempts to
  7867. make the cursor visible will not actually do so until the
  7868. invisibility depth reaches zero.  In other words, if you call
  7869. MMCursorOff when the cursor is already invisible, the cursor
  7870. will not reappear until you've told it to reappear as many
  7871. times as you told it to disappear.  This is fairly demented,
  7872. but that's the way Microsoft made it.
  7873.  
  7874. This routine will not work properly if no mouse is installed.
  7875. See MMCheck.
  7876.  
  7877.    MMCursorOff
  7878.  
  7879. Name  : MMCursorOn           (Mouse Cursor On)
  7880. Class : Mouse
  7881. Level : BIOS
  7882.  
  7883. This routine makes the mouse cursor visible, or tries to do
  7884. so...
  7885.  
  7886. The mouse cursor is somewhat bizarre in that an "invisibility
  7887. level" is kept.  Every time you use MMCursorOff, the
  7888. invisibility depth is increased; subsequent attempts to make
  7889. the cursor visible will not actually do so until the
  7890. invisibility depth reaches zero.  In other words, if you call
  7891. MMCursorOff when the cursor is already invisible, the cursor
  7892. will not reappear until you've told it to reappear (with
  7893. MMCursorOn) as many times as you told it to disappear.  This is
  7894. fairly demented, but that's the way Microsoft made it.
  7895.  
  7896. Note that there is a flaw in BASIC such that a "mouse dropping"
  7897. may be left on the screen if your program is invoked at the
  7898. bottom of the DOS screen, causing a scroll while the mouse
  7899. cursor is visible.  To avoid this, use VIEW PRINT at the
  7900. beginning of your program to remove the default "status line".
  7901. For the standard 80x25 text screen, this would be done like so:
  7902.  
  7903.    VIEW PRINT 1 TO 25
  7904.  
  7905. This routine will not work properly if no mouse is installed.
  7906. See MMCheck or MMCheck2%.
  7907.  
  7908.    MMCursorOn
  7909.  
  7910. Name  : MMGetLoc             (Mouse Get Location)
  7911. Class : Mouse
  7912. Level : BIOS
  7913.  
  7914. This routine allows you to get the current location of the
  7915. mouse cursor.  It doesn't matter if the cursor is visible or
  7916. invisible.
  7917.  
  7918. The mouse cursor location is somewhat perverse in CGA and text
  7919. modes, due to the sloppy design of Microsoft's original mouse
  7920. driver.  In text modes and both CGA graphics modes, the cursor
  7921. is returned as if the screen is 640x200. To correct this for
  7922. SCREEN 1, divide the X coordinate by two.  To correct this for
  7923. text modes, divide each coordinate by eight.
  7924.  
  7925. This routine will not work properly if there is no mouse
  7926. available.  Use the MMCheck routine if you are not sure.
  7927.  
  7928. See also GetMouseLoc, which returns the appropriate coordinates
  7929. for text mode.
  7930.  
  7931.    MMGetLoc X%, Y%
  7932.  
  7933. -------
  7934. X%         X coordinate ("column")
  7935. Y%         Y coordinate ("row")
  7936.  
  7937. Name  : MMSetLoc             (Mouse Set Location)
  7938. Class : Mouse
  7939. Level : BIOS
  7940.  
  7941. This routine allows you to set the current location of the
  7942. mouse cursor.  It doesn't matter if the cursor is visible or
  7943. invisible.
  7944.  
  7945. The mouse cursor location is somewhat perverse in CGA and text
  7946. modes, due to the sloppy design of Microsoft's original mouse
  7947. driver.  In text modes and both CGA graphics modes, the cursor
  7948. is returned as if the screen is 640x200. To correct this for
  7949. SCREEN 1, double the X coordinate.  To correct this for text
  7950. modes, multiply each coordinate by eight and add four.
  7951.  
  7952. This routine will not work properly if there is no mouse
  7953. available.  Use the MMCheck routine if you are not sure.
  7954.  
  7955. See also SetMouseLoc, which does the coordinate conversions for
  7956. you in text mode.
  7957.  
  7958.    MMSetLoc X%, Y%
  7959.  
  7960. X%         X coordinate ("column")
  7961. Y%         Y coordinate ("row")
  7962.  
  7963. Name  : MMSetRange           (Mouse Set Range)
  7964. Class : Mouse
  7965. Level : BIOS
  7966.  
  7967. This routine allows you to set the allowable range of mouse
  7968. cursor locations. The mouse cursor will not be permitted to go
  7969. outside this range.  It doesn't matter if the cursor is visible
  7970. or invisible.
  7971.  
  7972. The mouse cursor location is somewhat perverse in CGA and text
  7973. modes, due to the sloppy design of Microsoft's original mouse
  7974. driver.  In text modes and both CGA graphics modes, the cursor
  7975. is returned as if the screen is 640x200. To correct this for
  7976. SCREEN 1, double the X coordinate.  To correct this for text
  7977. modes, multiply each coordinate by eight and add four.
  7978.  
  7979. This routine will not work properly if there is no mouse
  7980. available.  Use the MMCheck routine if you are not sure.
  7981.  
  7982.    MMSetRange X1%, Y1%, X2%, Y2%
  7983.  
  7984. X1%       left   X coordinate (upper left "column")
  7985. Y1%       top    Y coordinate (upper left "row")
  7986. X2%       right  X coordinate (lower right "column")
  7987. Y2%       bottom Y coordinate (lower right "row")
  7988.  
  7989. Name  : Month0               (Month)
  7990. Class : String / Time
  7991. Level : Any
  7992.  
  7993. Given a month number, this routine tells you the name of the
  7994. month.
  7995.  
  7996.    MonthName$ = SPACE$(9)
  7997.    Month0 MonthName$, NameLen%, MonthNr%
  7998.    MonthName$ = LEFT$(MonthName$, NameLen)
  7999.  
  8000. MonthNr%    month number (1-12)
  8001. -------
  8002. MonthName$  name of the month.  Init to at least 9 characters.
  8003. NameLen%    length of the month name
  8004.  
  8005. Name  : MouseBuffer          (Mouse Buffer size)
  8006. Class : Mouse
  8007. Level : BIOS
  8008.  
  8009. This routine is used before MouseSave in order to find out how
  8010. many bytes are needed to save the mouse state.
  8011.  
  8012. This routine will not work properly if there is no mouse
  8013. available.  Use the MMCheck routine if you are not sure.
  8014.  
  8015.    MouseBuffer Bytes%
  8016.    St$ = SPACE$(Bytes%)
  8017.    MouseSave St$
  8018.  
  8019. -------
  8020. Bytes%     number of bytes needed to save the state of the mouse
  8021.  
  8022. Name  : MouseCursor          (Mouse Cursor type)
  8023. Class : Mouse
  8024. Level : BIOS
  8025.  
  8026. The MouseCursor routine allows you to select one of a number of
  8027. graphics mouse cursors.  The following types are supported:
  8028.  
  8029.     0   hourglass ("please wait" symbol)
  8030.     1   standard arrow pointer
  8031.     2   pointing hand
  8032.     3   crosshair
  8033.     4   target (box-in-a-box pointer)
  8034.     5   grabbing hand
  8035.  
  8036. If you'd like other shapes, please suggest a few!  I'll be glad
  8037. to add them.
  8038.  
  8039.    MouseCursor CursorNr%
  8040.  
  8041. CursorNr%    type of mouse graphics cursor to use (see above)
  8042.  
  8043. Name  : MousePen             (Mouse light Pen emulation)
  8044. Class : Mouse
  8045. Level : BIOS
  8046.  
  8047. The mouse can be made to emulate a light pen, allowing you to
  8048. use BASIC's light pen routines to provide a certain minimal
  8049. level of support for both light pens and mice.  This emulation
  8050. is on by default, but you can turn it off in case there is an
  8051. actual light pen attached.
  8052.  
  8053. This routine will not work properly if there is no mouse
  8054. available.  Use the MMCheck routine if you are not sure.
  8055.  
  8056.    MousePen EmulatePen%
  8057.  
  8058. EmulatePen%   whether mouse should emulate light pen (0 no)
  8059.  
  8060. Name  : MouseRest            (Mouse status Restore)
  8061. Class : Mouse
  8062. Level : BIOS
  8063.  
  8064. This routine is for use in conjunction with MouseSave.  It
  8065. allows you to restore the mouse settings to a state that was
  8066. saved in the past.
  8067.  
  8068. This routine will not work properly if there is no mouse
  8069. available.  Use the MMCheck routine if you are not sure.
  8070.  
  8071.    MouseRest St$
  8072.  
  8073. St$        mouse state to restore
  8074.  
  8075. Name  : MouseSave            (Mouse status Save)
  8076. Class : Mouse
  8077. Level : BIOS
  8078.  
  8079. This one is handy for use in subprograms or when SHELLing to
  8080. other programs that may use the mouse.  It allows you to save
  8081. the current mouse settings as a string.  To find out how long
  8082. the string should be, use MouseBuffer.
  8083.  
  8084. This routine will not work properly if there is no mouse
  8085. available.  Use the MMCheck routine if you are not sure.
  8086.  
  8087.    MouseBuffer Bytes%
  8088.    St$ = SPACE$(Bytes%)
  8089.    MouseSave St$
  8090.  
  8091. -------
  8092. St$        saved mouse state.  Init as shown above.
  8093.  
  8094. Name  : MPrint               (MS-DOS Print)
  8095. Class : Display
  8096. Level : BIOS
  8097.  
  8098. The MPrint routine displays text using mostly DOS services.
  8099. This allows it to handle ANSI codes if an ANSI driver is
  8100. installed.  In addition, the output of MPrint is confined to a
  8101. region of the screen that you may select with MWindow.  By
  8102. default, the region is 1,1 to 25,80: a full 80x25 text screen.
  8103.  
  8104. Using MPrint is similar to using PRINT followed by a semicolon.
  8105. It does not automatically move to the next line.  To do so, you
  8106. must MPrint a carriage return and linefeed: CHR$(13) + CHR$(10).
  8107.  
  8108. To clear the MWindow region, MPrint a formfeed: CHR$(12).
  8109.  
  8110.    MPrint St$
  8111.  
  8112. St$         string to display
  8113.  
  8114. Name  : MulMatI              (Multiply Matrix by Integer)
  8115. Class : Array management
  8116. Level : Any
  8117.  
  8118. This routine multiplies as many elements of an integer array as
  8119. you like by a given number, starting at a specified place in
  8120. the array.  If there was a numeric overflow at any point in the
  8121. operation, an error code will be returned.
  8122.  
  8123.    MulMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  8124.  
  8125. DSeg%      segment of the array element to start at
  8126. DOfs%      offset of the array element to start at
  8127. Elements%  number of array elements to process
  8128. Value%     value to multiply each array element by
  8129. -------
  8130. ErrCode%   error code: 0 if no error
  8131.  
  8132. Name  : MultiAND             (Multiple AND)
  8133. Class : String
  8134. Level : Any
  8135.  
  8136. The MultiAND routine performs an arithmetic "AND" operation on
  8137. each character in a string.
  8138.  
  8139. Among the varied uses for MultiAND is stripping the high bit
  8140. from characters, as you might want to do in telecommunications
  8141. or in converting WordStar files.  In that case, you would use a
  8142. BitMask% of 127.
  8143.  
  8144.    MultiAND St$, BitMask%
  8145.  
  8146. St$        string to process
  8147. BitMask%   bit mask (0-255) with which to AND each character
  8148. -------
  8149. St$        processed string
  8150.  
  8151. Name  : MultiOR              (Multiple OR)
  8152. Class : String
  8153. Level : Any
  8154.  
  8155. The MultiOR routine performs an arithmetic "OR" operation on
  8156. each character in a string.
  8157.  
  8158.    MultiOR St$, BitMask%
  8159.  
  8160. St$        string to process
  8161. BitMask%   bit mask (0-255) with which to OR each character
  8162. -------
  8163. St$        processed string
  8164.  
  8165. Name  : MultiXOR             (Multiple XOR)
  8166. Class : String
  8167. Level : Any
  8168.  
  8169. The MultiXOR routine performs an arithmetic "XOR" operation on
  8170. each character in a string.
  8171.  
  8172.    MultiXOR St$, BitMask%
  8173.  
  8174. St$        string to process
  8175. BitMask%   bit mask (0-255) with which to XOR each character
  8176. -------
  8177. St$        processed string
  8178.  
  8179. Name  : MWindow              (MS-DOS Window)
  8180. Class : Display
  8181. Level : Any
  8182.  
  8183. The MWindow routine works in conjunction with MPrint.  It
  8184. defines an area of the screen in which text displayed by MPrint
  8185. must stay.  The default window is 1,1 to 25,80.
  8186.  
  8187.    MWindow TopRow%, LeftCol%, BottomRow%, RightCol%
  8188.  
  8189. TopRow%     top row
  8190. LeftCol%    left column
  8191. BottomRow%  bottom row
  8192. RightCol%   right column
  8193.  
  8194. Name  : NameCase             (Name Case)
  8195. Class : String
  8196. Level : Any
  8197.  
  8198. This routine provides a specialized uppercase/lowercase
  8199. converter designed especially for names.  It converts the first
  8200. letter in each word in a string to uppercase, with the rest of
  8201. the word being converted to lowercase.
  8202.  
  8203. See also NameCase2, the FUNCTION version of this routine.
  8204.  
  8205.    NameCase St$
  8206.  
  8207. St$         string to process
  8208. -------
  8209. St$         processed string
  8210.  
  8211. Name  : NameCase2$           (Name Case)
  8212. Class : String
  8213. Level : Any
  8214.  
  8215. This routine provides a specialized uppercase/lowercase
  8216. converter designed especially for names.  It converts the first
  8217. letter in each word in a string to uppercase, with the rest of
  8218. the word being converted to lowercase.
  8219.  
  8220. See also NameCase, the SUB version of this routine.
  8221.  
  8222.    Result$ = NameCase2$(St$)
  8223.  
  8224. St$         string to process
  8225. -------
  8226. Result$     processed string
  8227.  
  8228. Name  : Num2Phone$           (compressed phone# to string)
  8229. Class : Numeric String
  8230. Level : Any
  8231.  
  8232. This function takes a phone number (as encoded by Phone2Num&)
  8233. and converts it to unformatted string form.  Depending on the
  8234. original number, the result may be 4, 7, or 10 characters in
  8235. length.  An invalid code will result in a null string.
  8236.  
  8237. NOTE that this function will handle current US-style phone
  8238. numbers.  It expects the first three digits of a 10-digit phone
  8239. number to represent an area code, where the middle digit of the
  8240. area code is always either zero or one.  This convention is
  8241. expected to change as of 1994 or so, whereupon this function
  8242. will no longer be reliable <sigh>.
  8243.  
  8244.    Result$ = Num2Phone$(PhoneNumber&)
  8245.  
  8246. PhoneNumber&    encoded phone number
  8247. -------
  8248. Result$         phone number ("" if invalid number)
  8249.  
  8250. Name  : NumFormat            (Number Format)
  8251. Class : Numeric
  8252. Level : DOS
  8253.  
  8254. This works just like PRINT USING, but returns the results in a
  8255. string rather than sending them to the display or a file.
  8256.  
  8257. Note that an interaction between QuickBASIC, DOS and some
  8258. networks means that this routine will briefly access the
  8259. default drive.  Strange but true.
  8260.  
  8261.    NumFormat Format$, Number#, Result$
  8262.  
  8263. Format$     numeric format
  8264. Number#     number to format
  8265. -------
  8266. Result$     formatted number
  8267.  
  8268. Name  : NumProc              (Numeric Processor)
  8269. Class : Equipment
  8270. Level : Any
  8271.  
  8272. NumProc returns the type of numeric coprocessor installed.  I
  8273. haven't tried it with a 80486, but I would guess an 80486
  8274. always appears to have an 80387 (unless it's one of those
  8275. brain-damaged 80486SX chips).
  8276.  
  8277. Results are returned as follows:
  8278.  
  8279.    0    no math chip
  8280.    1    8087
  8281.    2    80287
  8282.    3    80387
  8283.  
  8284. If anyone can tell me how to better handle a 486 here, I'd
  8285. appreciate it.
  8286.  
  8287.    NumProc ProcType%
  8288.  
  8289. -------
  8290. ProcType%    type of numeric coprocessor (see above)
  8291.  
  8292. Name  : NumProc2%            (Numeric Processor)
  8293. Class : Equipment
  8294. Level : Any
  8295.  
  8296. NumProc2% returns the type of numeric coprocessor installed.  I
  8297. haven't tried it with a 80486, but I would guess an 80486
  8298. always appears to have an 80387 (unless it's one of those
  8299. brain-damaged 80486SX chips).
  8300.  
  8301.  
  8302. Results are returned as follows:
  8303.  
  8304.    0    no math chip
  8305.    1    8087
  8306.    2    80287
  8307.    3    80387
  8308.  
  8309. If anyone can tell me how to better handle a 486 here, I'd
  8310. appreciate it.
  8311.  
  8312.    ProcType% = NumProc2%
  8313.  
  8314. -------
  8315. ProcType%    type of numeric coprocessor (see above)
  8316.  
  8317. Name  : ObjScan              (Object file Scan)
  8318. Class : Disk
  8319. Level : DOS
  8320.  
  8321. This routine returns information about a specified .OBJ file.
  8322. It returns the module name, public names, and external names.
  8323. The module name is generally the name of the original file
  8324. which was compiled to produce the .OBJ file. Public names are
  8325. the names of routines (and sometimes variables) that can be
  8326. accessed by outside programs.  External names are the names of
  8327. routines (and variables) that the .OBJ file expects to be
  8328. provided by outside programs.
  8329.  
  8330. External names containing "$", starting with "_" or with
  8331. lowercase characters are screened out to avoid returning a huge
  8332. list of BASIC internal routines. For the same reason, routines
  8333. ending with "QQ" will also be screened out, as will
  8334. STRINGADDRESS, STRINGASSIGN, STRINGLENGTH, and STRINGRELEASE.
  8335. Y'know, it would be nice if Microsoft followed some sort of
  8336. standard for its names.
  8337.  
  8338. The public and external names are returned in string arrays.
  8339. ObjScan will fail with an error code if there is insufficient
  8340. space, so be sure to allow plenty of room.  If scanning
  8341. subprograms, a DIM to 30 or 40 elements is probably ample.  If
  8342. scanning large programs, you may need to increase the
  8343. dimensions substantially.
  8344.  
  8345. The ObjScan routine can be used as the basis for a simple ".OBJ
  8346. info" utility or for more complex applications, such as library
  8347. management.
  8348.  
  8349.    ObjScan ObjFile$, ModName$, Routine$(), External$(), ErrCode%
  8350.  
  8351. ObjFile$      name of .OBJ file
  8352. -------
  8353. ModName$      module name
  8354. Routine$()    public names
  8355. External$()   external names
  8356. ErrCode%      whether there was an error (0 no)
  8357.  
  8358. Name  : Odd%                 (Odd integer?)
  8359. Class : Numeric
  8360. Level : Any
  8361.  
  8362. This function returns whether an integer is odd.  If so, it
  8363. returns -1, otherwise 0.
  8364.  
  8365.    Result% = Odd%(Number%)
  8366.  
  8367. Number%    number to test
  8368. -------
  8369. Result%    whether the number is odd
  8370.  
  8371. Name  : OddL%                 (Odd Long integer?)
  8372. Class : Numeric
  8373. Level : Any
  8374.  
  8375. This function returns whether a long integer is odd.  If so, it
  8376. returns -1, otherwise 0.
  8377.  
  8378.    Result% = Odd%(Number&)
  8379.  
  8380. Number&    number to test
  8381. -------
  8382. Result%    whether the number is odd
  8383.  
  8384. Name  : OrSt                 (OR String)
  8385. Class : String
  8386. Level : Any
  8387.  
  8388. This routine ORs each byte in one string with the corresponding
  8389. byte in a second string.  The strings must be the same length.
  8390.  
  8391.    OrSt St1$, St2$
  8392.  
  8393. St1$      string to OR
  8394. St2$      string to OR with
  8395. -------
  8396. St1$      result
  8397.  
  8398. Name  : ParseFSpec           (Parse File Specification)
  8399. Class : Disk
  8400. Level : Any
  8401.  
  8402. This routine splits a file specification into a drive,
  8403. subdirectory, and filename.  You are expected to initialize the
  8404. return strings to reasonable values beforehand (1 for drive, 64
  8405. for subdirectory, 12 for filename).  If the filespec may be
  8406. invalid, you may wish to leave additional space to avoid
  8407. potentially disastrous overflows.  An alternative would be to
  8408. use ExtendFSpec beforehand to check and complete the file
  8409. specification.  This is likely to be a good approach anyway--
  8410. these two routines complement each other nicely.
  8411.  
  8412.    Drive$ = SPACE$(1)
  8413.    Subdir$ = SPACE$(64)
  8414.    File$ = SPACE$(12)
  8415.    ParseFSpec FileSpec$, Drive$, DLen%, Subdir$, SLen%,
  8416.       File$, FLen%
  8417.    Drive$ = LEFT$(Drive$, DLen%)
  8418.    Subdir$ = LEFT$(Subdir$, SLen%)
  8419.    File$ = LEFT$(File$, FLen%)
  8420.  
  8421. FileSpec$   file specification
  8422. -------
  8423. Drive$      drive letter (init to 1+)
  8424. DLen%       length of Drive$
  8425. SubDir$     subdirectory (init to 64+)
  8426. SLen%       length of Subdir$
  8427. File$       file name (init to 12+)
  8428. FLen%       length of File$
  8429.  
  8430. Name  : PatchDone            (Patch Done)
  8431. Class : Disk
  8432. Level : DOS
  8433.  
  8434. This routine closes the file opened by FindPatch.  You must use
  8435. PatchDone when you are finished patching the file.
  8436.  
  8437. Routines in this set include FindPatch, SetPatch, and PatchDone.
  8438.  
  8439.    PatchDone
  8440.  
  8441. Name  : PCDat$               (PC Date)
  8442. Class : Equipment
  8443. Level : Clone
  8444.  
  8445. The PCDat$ routine tells you the date of the BIOS ROM chip.
  8446. This date is not always available on some (mostly older)
  8447. clones, in which case "No Date" is returned.
  8448.  
  8449.    ROMDate$ = PCDat$
  8450.  
  8451. -------
  8452. ROMDate$   date of the BIOS ROM (xx/xx/xx).
  8453.  
  8454. Name  : PCDate               (PC Date)
  8455. Class : Equipment
  8456. Level : Clone
  8457.  
  8458. The PCDate routine tells you the date of the BIOS ROM chip.
  8459. This date is not always available on some (mostly older)
  8460. clones, in which case "No Date " is returned.  See also PCDat,
  8461. a function version of this routine.
  8462.  
  8463.    ROMDate$ = SPACE$(8)
  8464.    PCDate ROMDate$
  8465.  
  8466. -------
  8467. ROMDate$   date of the BIOS ROM (xx/xx/xx).  Init to 8+ chars.
  8468.  
  8469. Name  : PCType               (PC Type)
  8470. Class : Equipment
  8471. Level : Clone
  8472.  
  8473. This routine returns the machine I.D. code.  This code may not
  8474. be one of the listed values for some (mostly older) clones, but
  8475. the following is usually correct:
  8476.  
  8477.    I.D.  ....Machine....
  8478.    255   PC or XT
  8479.    254   XT
  8480.    253   PCjr
  8481.    252   PC AT
  8482.    251   XT
  8483.    250   PS/2 Model 30
  8484.    249   PC Convertible
  8485.    248   PS/2 Model 70 or 80
  8486.    154   Compaq Portable
  8487.     45   Compaq Portable
  8488.  
  8489. Note that, for identification purposes, a PC and XT are
  8490. essentially the same. The XT is simply a PC with an auto-boot
  8491. hard drive.  New I.D. numbers come out more or less at random
  8492. from IBM, although they aren't as capricious about it as they
  8493. used to be.  It is useful to identify Compaq Portables as
  8494. separate from PCs because those machines had an unusual
  8495. display, which acts like a CGA but has the resolution (in text
  8496. modes) of an MDA.  Hence, the cursor size of a Compaq Portable
  8497. is MDA-sized in text mode, but CGA-sized in graphics modes,
  8498. even though ordinary tests will tell your program that a CGA is
  8499. attached.  If you intend to alter the cursor size, this is an
  8500. important distinction, since the Compaq Portable was a great
  8501. success and is still in wide use.  Current Compaq machines,
  8502. like most other clones, follow the standard IBM I.D. codes.
  8503.  
  8504. See also PCType2, a function version of this routine.
  8505.  
  8506.    PCType MachineID%
  8507.  
  8508. -------
  8509. MachineID%   type of computer
  8510.  
  8511. Name  : PCType2%             (PC Type)
  8512. Class : Equipment
  8513. Level : Clone
  8514.  
  8515. This routine returns the machine I.D. code.  This code may not
  8516. be one of the listed values for some (mostly older) clones, but
  8517. the following is usually correct:
  8518.    I.D.  ....Machine....
  8519.    255   PC or XT
  8520.    254   XT
  8521.    253   PCjr
  8522.    252   PC AT
  8523.    251   XT
  8524.    250   PS/2 Model 30
  8525.    249   PC Convertible
  8526.    248   PS/2 Model 70 or 80
  8527.    154   Compaq Portable
  8528.     45   Compaq Portable
  8529.  
  8530. Note that, for identification purposes, a PC and XT are
  8531. essentially the same. The XT is simply a PC with an auto-boot
  8532. hard drive.  New I.D. numbers come out more or less at random
  8533. from IBM, although they aren't as capricious about it as they
  8534. used to be.  It is useful to identify Compaq Portables as
  8535. separate from PCs because those machines had an unusual
  8536. display, which acts like a CGA but has the resolution (in text
  8537. modes) of an MDA.  Hence, the cursor size of a Compaq Portable
  8538. is MDA-sized in text mode, but CGA-sized in graphics modes,
  8539. even though ordinary tests will tell your program that a CGA is
  8540. attached.  If you intend to alter the cursor size, this is an
  8541. important distinction, since the Compaq Portable was a great
  8542. success and is still in wide use.  Current Compaq machines,
  8543. like most other clones, follow the standard IBM I.D. codes.
  8544.  
  8545.    MachineID% = PCType2%
  8546.  
  8547. -------
  8548. MachineID%   type of computer
  8549.  
  8550. Name  : Phone2Num&           (Phone# to Number)
  8551. Class : Numeric String
  8552. Level : Any
  8553.  
  8554. This function converts a U.S. or Canadian phone number from
  8555. string form to a long integer.  It accepts phone numbers of 4,
  8556. 7, 10, or 11 digits.  If there are 11 digits, the first digit
  8557. must be a 1.  Non-numeric characters are ignored so that
  8558. formatted phone numbers can be used.  If the phone number is of
  8559. the wrong length or otherwise does not appear to be valid, -1
  8560. is returned; otherwise, the result is a long integer which
  8561. represents the phone number in a format that can be decoded by
  8562. Num2Phone$.
  8563.  
  8564. This function will accept alphabetic phone numbers and convert
  8565. them to their numeric equivalents.
  8566.  
  8567. Since it only takes 4 bytes to store a long integer, as opposed
  8568. to 7 to 10 or more for the usual alphanumeric form, this can be
  8569. considered a compression routine as well as a validation
  8570. routine.  At worst, for 4-digit phone numbers, it is exactly as
  8571. efficient as a character representation.  For 7 or 10-digit
  8572. phone numbers, it roughly doubles your storage space.
  8573.  
  8574. A few words on how checking is done: obviously, there is no way
  8575. to tell whether a number is in use or is in fact whoever you
  8576. wished to call.  However, there are certain regularities to
  8577. numeric phone numbers which can be used to detect blatantly
  8578. false numbers.  Alphabetic phone numbers do not include all the
  8579. letters of the alphabet, either.  This routine will check for
  8580. any obvious peculiarities and warn you accordingly.
  8581.  
  8582. NOTE that this function will handle current US-style phone
  8583. numbers.  It expects the first three digits of a 10-digit phone
  8584. number to represent an area code, where the middle digit of the
  8585. area code is always either zero or one.  This convention is
  8586. expected to change as of 1994 or so, whereupon this function
  8587. will no longer be reliable <sigh>.
  8588.  
  8589.    Result& = Phone2Num&(PhoneNumber$)
  8590.  
  8591. PhoneNumber$    phone number (may be formatted)
  8592. -------
  8593. Result&         encoded phone number (-1 if invalid number)
  8594.  
  8595. Name  : PrintBox             (Print a Box)
  8596. Class : Display
  8597. Level : Clone
  8598.  
  8599. This routine displays a box, filled with a character or string
  8600. of your choice.  Only text modes are supported.
  8601.  
  8602.    PrintBox St$, TopRow%, LftCol%, BotRow%, RhtCol%, VAttr%, _
  8603.      Page%, Fast%
  8604.  
  8605. St$        string to fill box with (one or more chars)
  8606. TopRow%    top row of box
  8607. LftCol%    left column of box
  8608. BotRow%    bottom row of box
  8609. RhtCol%    right column of box
  8610. VAttr%     color/attribute of box (see CalcAttr)
  8611. Page%      display page (for color adapters)
  8612. Fast%      display speed (-1 fast, 0 slow for old CGAs)
  8613.  
  8614. Name  : PrinterInit          (Printer Initialize)
  8615. Class : Printer
  8616. Level : BIOS
  8617.  
  8618. This routine initializes a printer in the same way as if the
  8619. computer had been rebooted.
  8620.  
  8621. Note that this will not work on serial printers, even if the
  8622. MODE command was used to redirect the port.  It works at the
  8623. BIOS level, so it doesn't know about any fooling around DOS
  8624. does.
  8625.  
  8626.    PrinterInit Port%
  8627.  
  8628. Port%         parallel port number (1-3)
  8629.  
  8630. Name  : PrinterReady%        (Printer Ready)
  8631. Class : Printer
  8632. Level : BIOS
  8633.  
  8634. This function lets you know if a printer is ready.  It checks
  8635. to make sure that the specified port exists, then makes sure a
  8636. printer is connected, turned on, and has paper in it.
  8637.  
  8638. Note that this will not work on serial printers, even if the
  8639. MODE command was used to redirect the port.  It works at the
  8640. BIOS level, so it doesn't know about any fooling around DOS
  8641. does.
  8642.  
  8643.    Ready% = PrinterReady%(Port%)
  8644.  
  8645. Port%         parallel port number (1-3)
  8646. -------
  8647. Ready%        whether there's a printer ready at that port
  8648.  
  8649. Name  : PrintFile            (Print File)
  8650. Class : Printer
  8651. Level : DOS
  8652.  
  8653. This routine sends a file to the printer.  It does not
  8654. paginate, spool, or anything else fancy.  The LPT1 or PRN
  8655. device is used by default, although you can change this using
  8656. the PrtSwap routine.
  8657.  
  8658. The predefined device handle for stdprn is used, so don't use
  8659. FClose1 to free that handle if you expect to use this routine.
  8660. The results could be nasty.
  8661.  
  8662.    PrintFile FileName$, ErrCode%
  8663.  
  8664. FileName$     name of the file to print
  8665. -------
  8666. ErrCode%      whether there was an error (0 no, else DOS Error)
  8667.  
  8668. Name  : PrintScreen          (Print Screen)
  8669. Class : Display / Printer
  8670. Level : BIOS
  8671.  
  8672. Just like pressing the PrtSc/PrintScrn key on the keyboard,
  8673. this routine sends the contents of the display to the printer.
  8674. It is mostly designed for text modes, but use of the GRAPHICS
  8675. TSR provided with DOS will allow it to print out CGA graphics
  8676. displays as well.  For some reason, the GRAPHICS utility does
  8677. not handle Hercules, EGA or VGA displays; however, alternative
  8678. utilities which provide such features may be obtained from your
  8679. local BBS.
  8680.  
  8681.    PrintScreen
  8682.  
  8683. Name  : Processor            (Processor)
  8684. Class : Equipment
  8685. Level : Any
  8686.  
  8687. Processor returns the type of processor (CPU) installed.
  8688.  
  8689. Results are returned as follows:
  8690.  
  8691.    0    NEC V20
  8692.    1    8088 or 8086
  8693.    2    80186
  8694.    3    80286
  8695.    4    80386
  8696.    5    80486
  8697.  
  8698. Note that, for most practical purposes, a NEC V20 works just
  8699. like an 80186.
  8700.  
  8701.    Processor ProcType%
  8702.  
  8703. -------
  8704. ProcType%    type of CPU (see above)
  8705.  
  8706. Name  : Processor2%          (Processor)
  8707. Class : Equipment
  8708. Level : Any
  8709.  
  8710. Processor returns the type of processor (CPU) installed.
  8711.  
  8712. Results are returned as follows:
  8713.  
  8714.    0    NEC V20
  8715.    1    8088 or 8086
  8716.    2    80186
  8717.    3    80286
  8718.    4    80386
  8719.    5    80486
  8720.  
  8721. Note that, for most practical purposes, a NEC V20 works just
  8722. like an 80186.
  8723.  
  8724.    ProcType% = Processor2%
  8725.  
  8726. -------
  8727. ProcType%    type of CPU (see above)
  8728.  
  8729. Name  : PrtSc                (Print Screen key)
  8730. Class : Input / Printer
  8731. Level : BIOS
  8732.  
  8733. This routine allows you to disable the "print screen" key.
  8734. This only affects the keyboard, not the PrintScreen routine in
  8735. PBClone.
  8736.  
  8737. When the print screen key is disabled, you can detect whether
  8738. it was pressed using the GetPrtSc% function.  This provides a
  8739. way of using the key for your own purposes.
  8740.  
  8741. If you disable the print screen key, be sure to enable it again
  8742. before your program ends.  Otherwise, the print screen key will
  8743. be left in an undefined state, probably causing the computer to
  8744. crash when it is next pressed.
  8745.  
  8746.    PrtSc Enable%
  8747.  
  8748. Enable%   whether print screen key should be enabled (0 if no)
  8749.  
  8750. Name  : PrtSwap              (Printer Swap)
  8751. Class : Printer
  8752. Level : Clone
  8753.  
  8754. It's handy to use LPRINT, but it isn't always practical.
  8755. LPRINT only works on the first printer available (PRN or
  8756. LPT1).  With this routine, it doesn't matter.  PrtSwap allows
  8757. you to swap any two printer ports.
  8758.  
  8759. Note that it's a good idea to swap the ports back to their
  8760. original locations before exiting your program.  You could
  8761. cause major confusion otherwise!
  8762.  
  8763.    PrtSwap Port1%, Port2%
  8764.  
  8765. Port1%    number of the first port (1-3)
  8766. Port2%    number of the second port (1-3)
  8767.  
  8768. Name  : PSortD               (Pointer Sort Double precision)
  8769. Class : Array management
  8770. Level : Any
  8771.  
  8772. This routine sorts the elements in a double precision array...
  8773. well, actually, it doesn't change the position of anything in
  8774. the double precision array.  It sorts the array using a set of
  8775. pointers to the array.  You can then use the pointers to refer
  8776. to the array or to re-order the array yourself.
  8777.  
  8778. Why bother with pointers?  Well, it's a lot faster than sorting
  8779. the numbers directly, since less information has to be
  8780. swapped.  It has another major advantage, though-- it allows
  8781. you to sort an array without losing track of how it corresponds
  8782. to any related arrays.
  8783.  
  8784. The array is assumed to start at element 1.  You may specify
  8785. the last element in the array, allowing you to sort only part
  8786. of an array if you like.
  8787.  
  8788. The pointer array must be initialized so that each element is
  8789. equal to its index.  Either use InitPtr or do:
  8790.    FOR tmp% = 1 TO Elements%
  8791.       Ptr%(tmp%) = tmp%
  8792.    NEXT
  8793.  
  8794. After this routine, you can access the sorted array via the
  8795. pointer array. For instance, to print out a sorted double
  8796. precision array, you'd use:
  8797.    FOR tmp% = 1 TO Elements%
  8798.       PRINT Array#(Ptr%(tmp%))
  8799.    NEXT
  8800.  
  8801. If you would like the results to be last-to-first, rather than
  8802. first-to-last, just call ReverseI to reverse the pointer array
  8803. (after this routine).
  8804.  
  8805.    PSortD Ptr%(), Array#(), Elements%
  8806.  
  8807. Ptr%()      pointers to array to be sorted
  8808. Array#()    array to be sorted
  8809. Elements%   number of elements in array
  8810. -------
  8811. Ptr%()      pointers which allow accessing array in sorted order
  8812.  
  8813. Name  : PSortI               (Pointer Sort Integer)
  8814. Class : Array management
  8815. Level : Any
  8816.  
  8817. This routine sorts the elements in an integer array... well,
  8818. actually, it doesn't change the position of anything in the
  8819. integer array.  It sorts the array using a set of pointers to
  8820. the array.  You can then use the pointers to refer to the array
  8821. or to re-order the array yourself.
  8822.  
  8823. Why bother with pointers?  It has a major advantage-- it allows
  8824. you to sort an array without losing track of how it corresponds
  8825. to any related arrays.
  8826.  
  8827. The array is assumed to start at element 1.  You may specify
  8828. the last element in the array, allowing you to sort only part
  8829. of an array if you like.
  8830.  
  8831. The pointer array must be initialized so that each element is
  8832. equal to its index.  Either use InitPtr or do:
  8833.    FOR tmp% = 1 TO Elements%
  8834.       Ptr%(tmp%) = tmp%
  8835.    NEXT
  8836.  
  8837. After this routine, you can access the sorted array via the
  8838. pointer array. For instance, to print out a sorted integer
  8839. array, you'd use:
  8840.    FOR tmp% = 1 TO Elements%
  8841.       PRINT Array%(Ptr%(tmp%))
  8842.    NEXT
  8843.  
  8844. If you would like the results to be last-to-first, rather than
  8845. first-to-last, just call ReverseI to reverse the pointer array
  8846. (after this routine).
  8847.  
  8848.    PSortI Ptr%(), Array%(), Elements%
  8849.  
  8850. Ptr%()      pointers to array to be sorted
  8851. Array%()    array to be sorted
  8852. Elements%   number of elements in array
  8853. -------
  8854. Ptr%()      pointers which allow accessing array in sorted order
  8855.  
  8856. Name  : PSortL               (Pointer Sort Long integer)
  8857. Class : Array management
  8858. Level : Any
  8859.  
  8860. This routine sorts the elements in a long integer array...
  8861. well, actually, it doesn't change the position of anything in
  8862. the long integer array.  It sorts the array using a set of
  8863. pointers to the array.  You can then use the pointers to refer
  8864. to the array or to re-order the array yourself.
  8865.  
  8866. Why bother with pointers?  Well, it's a lot faster than sorting
  8867. the numbers directly, since less information has to be
  8868. swapped.  It has another major advantage, though-- it allows
  8869. you to sort an array without losing track of how it corresponds
  8870. to any related arrays.
  8871.  
  8872. The array is assumed to start at element 1.  You may specify
  8873. the last element in the array, allowing you to sort only part
  8874. of an array if you like.
  8875.  
  8876. The pointer array must be initialized so that each element is
  8877. equal to its index.  Either use InitPtr or do:
  8878.    FOR tmp% = 1 TO Elements%
  8879.       Ptr%(tmp%) = tmp%
  8880.    NEXT
  8881.  
  8882. After this routine, you can access the sorted array via the
  8883. pointer array. For instance, to print out a sorted long integer
  8884. array, you'd use:
  8885.    FOR tmp% = 1 TO Elements%
  8886.       PRINT Array&(Ptr%(tmp%))
  8887.    NEXT
  8888.  
  8889. If you would like the results to be last-to-first, rather than
  8890. first-to-last, just call ReverseI to reverse the pointer array
  8891. (after this routine).
  8892.  
  8893.    PSortL Ptr%(), Array&(), Elements%
  8894.  
  8895. Ptr%()      pointers to array to be sorted
  8896. Array&()    array to be sorted
  8897. Elements%   number of elements in array
  8898. -------
  8899. Ptr%()      pointers which allow accessing array in sorted order
  8900.  
  8901. Name  : PSortS               (Pointer Sort Single precision)
  8902. Class : Array management
  8903. Level : Any
  8904.  
  8905. This routine sorts the elements in a single precision array...
  8906. well, actually, it doesn't change the position of anything in
  8907. the single precision array.  It sorts the array using a set of
  8908. pointers to the array.  You can then use the pointers to refer
  8909. to the array or to re-order the array yourself.
  8910.  
  8911. Why bother with pointers?  Well, it's a lot faster than sorting
  8912. the numbers directly, since less information has to be
  8913. swapped.  It has another major advantage, though-- it allows
  8914. you to sort an array without losing track of how it corresponds
  8915. to any related arrays.
  8916.  
  8917. The array is assumed to start at element 1.  You may specify
  8918. the last element in the array, allowing you to sort only part
  8919. of an array if you like.
  8920.  
  8921. The pointer array must be initialized so that each element is
  8922. equal to its index.  Either use InitPtr or do:
  8923.    FOR tmp% = 1 TO Elements%
  8924.       Ptr%(tmp%) = tmp%
  8925.    NEXT
  8926.  
  8927. After this routine, you can access the sorted array via the
  8928. pointer array. For instance, to print out a sorted single
  8929. precision array, you'd use:
  8930.    FOR tmp% = 1 TO Elements%
  8931.       PRINT Array!(Ptr%(tmp%))
  8932.    NEXT
  8933.  
  8934. If you would like the results to be last-to-first, rather than
  8935. first-to-last, just call ReverseI to reverse the pointer array
  8936. (after this routine).
  8937.  
  8938.    PSortS Ptr%(), Array!(), Elements%
  8939.  
  8940. Ptr%()      pointers to array to be sorted
  8941. Array!()    array to be sorted
  8942. Elements%   number of elements in array
  8943. -------
  8944. Ptr%()      pointers which allow accessing array in sorted order
  8945.  
  8946. Name  : PSortSt              (Pointer Sort String)
  8947. Class : Array management
  8948. Level : Any
  8949.  
  8950. This routine sorts the elements in a string array... well,
  8951. actually, it doesn't change the position of anything in the
  8952. string array.  It sorts the array using a set of pointers to
  8953. the array.  You can then use the pointers to refer to the array
  8954. or to re-order the array yourself.
  8955.  
  8956. Why bother with pointers?  Well, it's a lot faster than sorting
  8957. the strings directly, since less information has to be
  8958. swapped.  It has another major advantage, though-- it allows
  8959. you to sort an array without losing track of how it corresponds
  8960. to any related arrays.  For instance, if you have one array
  8961. holding names and another holding phone numbers, this allows
  8962. you to sort on names without losing track of which phone
  8963. numbers are which.
  8964.  
  8965. The array is assumed to start at element 1.  You may specify
  8966. the last element in the array, allowing you to sort only part
  8967. of an array if you like.  You can also specify whether the
  8968. capitalization of letters in a string should matter for sorting
  8969. purposes.
  8970.  
  8971. The pointer array must be initialized so that each element is
  8972. equal to its index.  Either use InitPtr or do:
  8973.    FOR tmp% = 1 TO Elements%
  8974.       Ptr%(tmp%) = tmp%
  8975.    NEXT
  8976.  
  8977. After this routine, you can access the sorted array via the
  8978. pointer array. For instance, to print out a sorted string
  8979. array, you'd use:
  8980.    FOR tmp% = 1 TO Elements%
  8981.       PRINT Array$(Ptr%(tmp%))
  8982.    NEXT
  8983.  
  8984. If you would like the results to be last-to-first, rather than
  8985. first-to-last, just call ReverseI to reverse the pointer array
  8986. (after this routine).
  8987.  
  8988.    PSortSt Ptr%(), Array$(), Elements%, CapsCount%
  8989.  
  8990. Ptr%()      pointers to array to be sorted
  8991. Array$()    array to be sorted
  8992. CapsCount%  use 0 if uppercase/lowercase distinctions don't matter
  8993. Elements%   number of elements in array
  8994. -------
  8995. Ptr%()      pointers which allow accessing array in sorted order
  8996.  
  8997. Name  : PutScreen            (Put Screen)
  8998. Class : Display
  8999. Level : Clone
  9000.  
  9001. This routine restores a portion of the display (which was saved
  9002. to an array by DGetScreen or GetScreen) to the screen.  Only
  9003. text modes are supported. If your program uses multiple display
  9004. pages, you can put the image onto any of those pages.  A
  9005. special "slow" mode is supported for the CGA, to prevent
  9006. flickering (a problem only with some CGAs).
  9007.  
  9008. If you wish to restore the entire screen, you may find ScrRest
  9009. easier (see).
  9010.  
  9011.    PutScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  9012.  
  9013. Array%()   array from which to restore the image
  9014. TRow%      top row of the desired screen area
  9015. LCol%      left column of the desired screen area
  9016. BRow%      bottom row of the desired screen area
  9017. RCol%      right column of the desired screen area
  9018. Page%      page on which to restore the display
  9019. Fast%      whether to use fast mode (0 no)
  9020.  
  9021. Name  : QPrint               (Quick Print)
  9022. Class : Display
  9023. Level : Clone
  9024.  
  9025. This is a replacement for the PRINT statement.  It is less
  9026. flexible in that it does not move the cursor or interpret
  9027. control codes, and because it uses the color that is already on
  9028. the screen instead of a specified color value. It also works
  9029. only in text modes.
  9030.  
  9031. In exchange, QPrint gives you much faster display speeds.
  9032.  
  9033. See also XQPrint, which is a bit more flexible (and somewhat
  9034. slower).
  9035.  
  9036.    QPrint St$, Row%, Column%, Page%, Fast%
  9037.  
  9038. St$        text to display
  9039. Row%       starting row
  9040. Column%    starting column
  9041. Page%      page on which to display
  9042. Fast%      whether to use fast mode (0 no)
  9043.  
  9044. Name  : Rand%                (Random number)
  9045. Class : Numeric
  9046. Level : Clone
  9047.  
  9048. This is a pseudo-random number function.  It returns a "random"
  9049. number in a range you specify (e.g., if you pass it 10, it will
  9050. return 0-9).  The number is less random than you'd get from the
  9051. BASIC function RND, and you can't set a random number seed a la
  9052. RANDOMIZE.  There is one major advantage to Rand%, however: it
  9053. doesn't bring in BASIC's floating point support, which makes it
  9054. much faster than RND and may make your program much smaller.
  9055.  
  9056.    Number% = Rand%(Range%)
  9057.  
  9058. Range%      range of desired pseudo-random number
  9059. -------
  9060. Number%     pseudo-random number from 0 to Range% - 1
  9061.  
  9062. Name  : ReadBitF             (Read Bit Field)
  9063. Class : Numeric
  9064. Level : Any
  9065.  
  9066. This routine allows you to get an element of a virtual array.
  9067. The actual array can be any numeric type, as it is just being
  9068. used as a storage area. The virtual array is composed of
  9069. numbers of a bit length that you specify (1-8).  This provides
  9070. efficient storage for numbers which have a limited range.
  9071.  
  9072. See also WriteBitF.
  9073.  
  9074.    ReadBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  9075.  
  9076. DSeg%        segment of actual array
  9077. DOfs%        offset of actual array
  9078. ElementNr&   virtual element number (starts at 0)
  9079. BitLen%      bits per virtual element (1-8)
  9080. -------
  9081. Value%       result (0-255 or less, depending on BitLen%)
  9082.  
  9083. Name  : ReadScreen           (Read Screen into string)
  9084. Class : Display
  9085. Level : Clone
  9086.  
  9087. This routine reads a string off the screen.  The screen must be
  9088. in text mode.
  9089.  
  9090. See also GetLine, which reads a row of text from a virtual or
  9091. saved screen.
  9092.  
  9093.    Result$ = SPACE$(10)    ' init to desired length
  9094.    ReadScreen Result$, Row%, Column%, Page%
  9095.  
  9096. Result$      result string: init to desired length first
  9097. Row%         row (1-25, 1-43, etc [depends on screen mode])
  9098. Column%      column (1-40, 1-80, etc [depends on mode])
  9099. Page%        page (0, 0-3, etc [depends on display and mode])
  9100.  
  9101. Name  : Reboot               (Reboot)
  9102. Class : Miscellaneous
  9103. Level : Clone
  9104.  
  9105. This routine restarts the computer, just like typing
  9106. Control-Alt-Del at the keyboard.
  9107.  
  9108.    Reboot
  9109.  
  9110. Name  : Recolor              (Recolor)
  9111. Class : Display
  9112. Level : Clone
  9113.  
  9114. The Recolor routine changes all text in one color to another
  9115. color.  It works only in text modes.  The colors are specified
  9116. as attributes (see CalcAttr).
  9117.  
  9118.    Recolor OldAttr%, NewAttr%
  9119.  
  9120. OldAttr%   color to be changed
  9121. NewAttr%   color to which to change
  9122.  
  9123. Name  : RecolorArea          (Recolor Area)
  9124. Class : Display
  9125. Level : Clone
  9126.  
  9127. The RecolorArea routine changes a specified area of the screen
  9128. to a specified color.  It works only in text modes.  The color
  9129. is specified as an attribute (see CalcAttr).
  9130.  
  9131. See also HiLite, which provides an easier way of highlighting
  9132. between two columns on a single row.
  9133.  
  9134.    RecolorArea TRow%, LCol%, BRow%, RCol%, VAttr%, Page%, Fast%
  9135.  
  9136. TRow%       top row of area to recolor
  9137. LCol%       left column of area to recolor
  9138. BRow%       bottom row of area to recolor
  9139. RCol%       right column of area to recolor
  9140. VAttr%      desired color
  9141. Page%       display page (normally zero)
  9142. Fast%       whether to use fast mode (0 no)
  9143.  
  9144. Name  : RedirectIn%          (Redirect Input)
  9145. Class : Miscellaneous
  9146. Level : DOS
  9147.  
  9148. The RedirectIn% function allows you to determine whether input
  9149. has been redirected.  This lets you know whether input is
  9150. coming from the keyboard or from a file or device.
  9151.  
  9152. Input that is done by BIOS key routines (e.g., BIOSInkey) is
  9153. not affected by redirection, so if you want to support
  9154. redirection it is best to avoid such routines unless there is
  9155. something that must come from the keyboard.
  9156.  
  9157.    Redir% = RedirectIn%
  9158.  
  9159. -------
  9160. Redir%     whether input has been redirected (0 no)
  9161.  
  9162. Name  : RedirectOut%         (Redirect Output)
  9163. Class : Miscellaneous
  9164. Level : DOS
  9165.  
  9166. The RedirectOut% function allows you to determine whether
  9167. output has been redirected.  This lets you know whether output
  9168. is going to the display or to a file or device.
  9169.  
  9170. Output that is done by direct screen writes (e.g., XQPrint) is
  9171. not affected by redirection, so if you want to allow
  9172. redirection it is best to avoid such routines unless there is
  9173. something that must to go to the screen itself.
  9174.  
  9175.    Redir% = RedirectOut%
  9176.  
  9177. -------
  9178. Redir%     whether output has been redirected (0 no)
  9179.  
  9180. Name  : Rename               (Rename file)
  9181. Class : Disk
  9182. Level : DOS
  9183.  
  9184. This routine allows you to rename an ordinary file.  See also
  9185. RenSub.
  9186.  
  9187.    Rename CurrentName$, NewName$, ErrCode%
  9188.  
  9189. CurrentName$   current name of the file
  9190. NewName$       desired name of the file
  9191. -------
  9192. ErrCode%       error code: 0 if no error, else DOS Error
  9193.  
  9194. Name  : RenSub               (Rename Subdirectory)
  9195. Class : Disk
  9196. Level : DOS
  9197.  
  9198. This routine provides a service that was inexplicably left out
  9199. of the DOS command shell.  It allows you to rename a
  9200. subdirectory.
  9201.  
  9202. Note that renaming a subdirectory is only possible using
  9203. old-style FCB file handling.  This means that the subdirectory
  9204. which you specify must be in the current directory (the routine
  9205. doesn't really understand subdirectories per se, but treats
  9206. them like any other file).  In this implementation, no drive
  9207. specification is allowed either.  Finally, if there is an
  9208. error, the error code may be a simple "255" instead of a useful
  9209. disk error number.
  9210.  
  9211.    RenSub CurrentSub$, NewSub$, ErrCode%
  9212.  
  9213. CurrentSub$   current name of the subdirectory
  9214. NewSub$       desired name of the subdirectory
  9215. -------
  9216. ErrCode%      error code: 0 if no error, else DOS Error
  9217.  
  9218. Name  : Replace              (Replace character)
  9219. Class : String
  9220. Level : Any
  9221.  
  9222. This routine replaces all occurrences of a given character in a
  9223. string with another character.
  9224.  
  9225.    Replace St$, CurCh$, NewCh$
  9226.  
  9227. St$         string to process
  9228. CurCh$      character to be replaced
  9229. NewCh$      character to replace with
  9230. -------
  9231. St$         processed string
  9232.  
  9233. Name  : ReplaceString        (Replace String)
  9234. Class : String
  9235. Level : Any
  9236.  
  9237. This routine replaces all occurrences of a given substring
  9238. within a string with another substring.  The substrings may be
  9239. of any length.
  9240.  
  9241. An error code will be returned if the string to search for is
  9242. null.
  9243.  
  9244.    ReplaceString St$, Old$, New$, Found%, ErrCode%
  9245.  
  9246. St$         string to process
  9247. Old$        substring to be replaced
  9248. New$        substring to replace with
  9249. -------
  9250. Found%      whether a replacement was done (0 if no)
  9251. ErrCode%    whether there was an error (0 if no)
  9252.  
  9253. Name  : Retries              (Retries)
  9254. Class : Disk
  9255. Level : DOS 3.1+
  9256.  
  9257. This routine allows you to adjust the handling of file-sharing
  9258. errors.  When such an error occurs, DOS normally retries 3
  9259. times, with a wait of 1 between tries.  This allows temporary
  9260. conditions, such as someone else using the file you want to
  9261. access, to clear up.  In many cases, though, you may want to
  9262. change this delay.  A shorter delay will improve response time,
  9263. allowing your program to handle the error more quickly.  A
  9264. longer delay may be more suited for a busy network, allowing
  9265. the request to proceed after a reasonable waiting period.
  9266.  
  9267. The delay period between each retry is unfortunately
  9268. machine-dependent, i.e., you will need larger delays on faster
  9269. machines to achieve the same effect. This can only be
  9270. considered a flaw in DOS.
  9271.  
  9272. Note that shorter waiting periods will improve response time
  9273. for your program, but may adversely affect the network.
  9274. Normally, you should use the longest waiting period with which
  9275. you feel comfortable.
  9276.  
  9277.    Retries Times%, WaitTime%
  9278.  
  9279. Times%     # of times to retry if file-sharing violation occurs
  9280. WaitTime%  amount of time to delay between retries
  9281.  
  9282. Name  : Reverse              (Reverse)
  9283. Class : String
  9284. Level : Any
  9285.  
  9286. This little fellow reverses the order of the characters in a
  9287. string.  It is one of the vital components of RInstr, but other
  9288. than that I see no real use for it.  On the other hand, George
  9289. Boole thought that Boolean logic was of solely theoretical
  9290. interest, and yet without it there would be no computers. I
  9291. leave it to you to find the earth-shattering possibilities of
  9292. Reverse!
  9293.  
  9294.    Reverse St$
  9295.  
  9296. St$      string to be reversed
  9297. -------
  9298. St$      reversed string
  9299.  
  9300. Name  : ReverseD             (Reverse Double precision array)
  9301. Class : Array management
  9302. Level : Any
  9303.  
  9304. This routine reverses the elements in an array of
  9305. double-precision numbers. This will probably be most useful for
  9306. an array sorted by SortD, in case you want the numbers to go
  9307. from largest to smallest.
  9308.  
  9309. The array is assumed to start at element 1.  You may specify
  9310. the last element in the array, allowing you to reverse only
  9311. part of an array if you like.
  9312.  
  9313.    ReverseD Array#(), Elements%
  9314.  
  9315. Array#()    array to be reversed
  9316. Elements%   number of elements in array
  9317. -------
  9318. Array#()    reversed array
  9319.  
  9320. Name  : ReverseI             (Reverse Integer array)
  9321. Class : Array management
  9322. Level : Any
  9323.  
  9324. This routine reverses the elements in an array of integers.
  9325. This will probably be most useful for an array sorted by SortI,
  9326. or a pointer array used in PSortD, PSortI, PSortL, PSortS, or
  9327. PSortSt, in case you want the values to go from largest to
  9328. smallest.
  9329.  
  9330. The array is assumed to start at element 1.  You may specify
  9331. the last element in the array, allowing you to reverse only
  9332. part of an array if you like.
  9333.  
  9334.    ReverseI Array%(), Elements%
  9335.  
  9336. Array%()    array to be reversed
  9337. Elements%   number of elements in array
  9338. -------
  9339. Array%()    reversed array
  9340.  
  9341. Name  : ReverseL             (Reverse Long integer array)
  9342. Class : Array management
  9343. Level : Any
  9344.  
  9345. This routine reverses the elements in an array of long
  9346. integers.  This will probably be most useful for an array
  9347. sorted by SortL, in case you want the values to go from largest
  9348. to smallest.
  9349.  
  9350. The array is assumed to start at element 1.  You may specify
  9351. the last element in the array, allowing you to reverse only
  9352. part of an array if you like.
  9353.  
  9354.    ReverseL Array&(), Elements%
  9355.  
  9356. Array&()    array to be reversed
  9357. Elements%   number of elements in array
  9358. -------
  9359. Array&()    reversed array
  9360.  
  9361. Name  : ReverseS             (Reverse Single precision array)
  9362. Class : Array management
  9363. Level : Any
  9364.  
  9365. This routine reverses the elements in an array of
  9366. single-precision numbers. This will probably be most useful for
  9367. an array sorted by SortS, in case you want the numbers to go
  9368. from largest to smallest.
  9369.  
  9370. The array is assumed to start at element 1.  You may specify
  9371. the last element in the array, allowing you to reverse only
  9372. part of an array if you like.
  9373.  
  9374.    ReverseS Array!(), Elements%
  9375.  
  9376. Array!()    array to be reversed
  9377. Elements%   number of elements in array
  9378. -------
  9379. Array!()    reversed array
  9380.  
  9381. Name  : ReverseSt            (Reverse String array)
  9382. Class : Array management
  9383. Level : Any
  9384.  
  9385. This routine reverses the elements in a string array.  This
  9386. will probably be most useful for an array sorted by SortSt, in
  9387. case you want the strings to be in reverse-alphabetical order.
  9388.  
  9389. The array is assumed to start at element 1.  You may specify
  9390. the last element in the array, allowing you to reverse only
  9391. part of an array if you like.
  9392.  
  9393.    ReverseSt Array$(), Elements%
  9394.  
  9395. Array$()    array to be reversed
  9396. Elements%   number of elements in array
  9397. -------
  9398. Array$()    reversed array
  9399.  
  9400. Name  : RInstr               (Reverse INSTR)
  9401. Class : String
  9402. Level : Any
  9403.  
  9404. Like INSTR, this routine tells you the position of a substring
  9405. within a string.  A "reverse" search is used, however-- whereas
  9406. INSTR tells you the first match, RInstr tells you the last
  9407. match.  Similarly, whereas INSTR will tell you that a null
  9408. search string matches the main string at the first position,
  9409. RInstr will match on the last position.  Of course, most of the
  9410. time you won't be searching for a null string!
  9411.  
  9412.    RInstr MainSt$, SeekSt$, Posn%
  9413.  
  9414. MainSt$    string to search
  9415. SeekSt$    string for which to search
  9416. -------
  9417. Posn%      position of substring within main string (0 no match)
  9418.  
  9419. Name  : RolSt                (Rotate Left String of bits)
  9420. Class : String
  9421. Level : Any
  9422.  
  9423. This routine rotates the bits in a string left by a desired
  9424. amount.  This may be helpful for manupulating strings
  9425. containing bit flags, images, et al.
  9426.  
  9427.    RolSt St$, Count%
  9428.  
  9429. St$       string to rotate left
  9430. Count%    bits by which to rotate
  9431. -------
  9432. St$       rotated string
  9433.  
  9434. Name  : RorSt                (Rotate Right String of bits)
  9435. Class : String
  9436. Level : Any
  9437.  
  9438. This routine rotates the bits in a string right by a desired
  9439. amount.  This may be helpful for manupulating strings
  9440. containing bit flags, images, et al.
  9441.  
  9442.    RorSt St$, Count%
  9443.  
  9444. St$       string to rotate right
  9445. Count%    bits by which to rotate
  9446. -------
  9447. St$       rotated string
  9448.  
  9449. Name  : RotateL              (Rotate Left)
  9450. Class : Numeric
  9451. Level : Any
  9452.  
  9453. This routine rotates the bits in an integer left by a desired
  9454. amount.
  9455.  
  9456.    RotateL Value%, Count%
  9457.  
  9458. Value%    number to rotate left
  9459. Count%    bits by which to rotate
  9460. -------
  9461. Value%    rotated number
  9462.  
  9463. Name  : RotateLL             (Rotate Left Long)
  9464. Class : Numeric
  9465. Level : Any
  9466.  
  9467. This routine rotates the bits in a long integer left by a
  9468. desired amount.
  9469.  
  9470.    RotateLL Value&, Count%
  9471.  
  9472. Value&    number to rotate left
  9473. Count%    bits by which to rotate
  9474. -------
  9475. Value&    rotated number
  9476.  
  9477. Name  : RotateR              (Rotate Right)
  9478. Class : Numeric
  9479. Level : Any
  9480.  
  9481. This routine rotates the bits in an integer right by a desired
  9482. amount.
  9483.  
  9484.    RotateR Value%, Count%
  9485.  
  9486. Value%    number to rotate right
  9487. Count%    bits by which to rotate
  9488. -------
  9489. Value%    rotated number
  9490.  
  9491. Name  : RotateRL             (Rotate Right Long)
  9492. Class : Numeric
  9493. Level : Any
  9494.  
  9495. This routine rotates the bits in a long integer right by a
  9496. desired amount.
  9497.  
  9498.    RotateRL Value&, Count%
  9499.  
  9500. Value&    number to rotate right
  9501. Count%    bits by which to rotate
  9502. -------
  9503. Value&    rotated number
  9504.  
  9505. Name  : RRotate              (Right Rotate string)
  9506. Class : String
  9507. Level : Any
  9508.  
  9509. This routine rotates the characters in a string right once.
  9510. I'll admit that I haven't found a use for this myself, but
  9511. people are always coming up with new uses for things... and it
  9512. complements the more useful LRotate routine.
  9513.  
  9514. See also LRotate.
  9515.  
  9516.    RRotate St$
  9517.  
  9518. St$      string to be rotated right once
  9519. -------
  9520. St$      string after being rotated right once
  9521.  
  9522. Name  : RScroll              (Right Scroll)
  9523. Class : Display
  9524. Level : Clone
  9525.  
  9526. This routine scrolls any selected part of the display right.
  9527. You may scroll as many times as you like, or scroll "zero"
  9528. times to totally clear the selected part of the display.
  9529.  
  9530.    RScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  9531.  
  9532. TopRow%      top row of the area to scroll
  9533. LeftCol%     left column of the area to scroll
  9534. BottomRow%   top row of the area to scroll
  9535. RightCol%    left column of the area to scroll
  9536. Times%       number of times (or rows) to scroll
  9537.  
  9538. Name  : ScanKey              (Scan Keyboard)
  9539. Class : Input
  9540. Level : BIOS
  9541.  
  9542. This one's like INKEY$, but a little bit more subtle.  It will
  9543. tell you if there's a key waiting (and if so, what key it is)
  9544. without actually getting the key.  The key will remain
  9545. available for later retrieval.
  9546.  
  9547. Among the more common uses for this routine is to handle keys
  9548. like Control-S (pause the display) and Control-C (abort).  You
  9549. can see if these keys have been pressed without disturbing
  9550. anything else the user might have typed.  DOS uses exactly this
  9551. technique for handling these keys.  Since BASIC doesn't go
  9552. through DOS I/O, though, the only way for you to support such
  9553. nice features is to write them into your program with ScanKey.
  9554.  
  9555.    ScanKey CharCode%, CharType%
  9556.  
  9557. -------
  9558. CharType%   key type: 0 none, 1 normal, 2 extended (scan code)
  9559. CharCode%   key ASCII or scan code
  9560.  
  9561. Name  : Scroll               (Scroll)
  9562. Class : Display
  9563. Level : BIOS
  9564.  
  9565. This routine scrolls any selected part of the display up.  You
  9566. may scroll as many times as you like, or scroll "zero" times to
  9567. totally clear the selected part of the display.
  9568.  
  9569. Note that BIOS-level scrolling can cause the screen to flicker
  9570. on some CGAs due to a combination of unfortunate design factors.
  9571.  
  9572.    Scroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  9573.  
  9574. TopRow      top row of the area to scroll
  9575. LeftCol%    left column of the area to scroll
  9576. BottomRow   top row of the area to scroll
  9577. RightCol%   left column of the area to scroll
  9578. Times%      number of times (or rows) to scroll
  9579.  
  9580. Name  : ScrRest              (Screen Restore)
  9581. Class : Display
  9582. Level : Clone
  9583.  
  9584. The ScrRest routine restores a display that was saved using
  9585. ScrSave or a similar routine.  It only works in text modes, and
  9586. expects an 80x25 screen.  See PutScreen or DPutScreen if you
  9587. need to work with other screen sizes.
  9588.  
  9589.    ScrRest Array%(), Page%, Fast%
  9590.  
  9591. Array%()   array holding the display information
  9592. Page%      page on which to restore the display
  9593. Fast%      whether to use fast mode (0 no)
  9594.  
  9595. Name  : ScrSave              (Screen Save)
  9596. Class : Display
  9597. Level : Clone
  9598.  
  9599. The ScrSave routine saves the display to an integer array.
  9600. Only text modes are supported.  For an 80x25 display, the array
  9601. must hold 4,000 bytes, so you would use DIM Array%(1 TO 2000).
  9602.  
  9603. ScrSave expects an 80x25 screen.  Use GetScreen or DGetScreen
  9604. if you need to work with other screen sizes.
  9605.  
  9606.    ScrSave Array%(), Page%, Fast%
  9607.  
  9608. Page%      display page to get
  9609. Fast%      whether to use fast mode (0 no)
  9610. -------
  9611. Array%()   saved display information
  9612.  
  9613. Name  : SCrunch              (Screen Crunch)
  9614. Class : Display
  9615. Level : Any
  9616.  
  9617. This routine is designed to be used in conjunction with ScrSave
  9618. and the other routines which store an entire 80x25 text screen
  9619. in an array.  It performs a "screen crunch", compressing the
  9620. original data into a new array.  The average result is about 8x
  9621. smaller than the original screen, resulting in a vast savings
  9622. in memory (4,000 bytes vs 500 or so).  The compression
  9623. algorithm is very fast and will not take any noticeable amount
  9624. of time for most purposes.
  9625.  
  9626. Besides saving main memory, this is great for storing screens
  9627. as disk files! The compression will not only make the file(s)
  9628. smaller, but will make disk access faster since there is less
  9629. information to transfer.
  9630.  
  9631. If you need to deal with text screen images of other than 80x25
  9632. in size, try the SCrunchSS routine instead.
  9633.  
  9634.    SCrunch DSeg%, DOfs%, CSeg%, COfs%, Bytes%
  9635.  
  9636. DSeg%     segment of the original screen image
  9637. DOfs%     offset of the original screen image
  9638. CSeg%     segment of array in which to store compressed image
  9639. COfs%     offset of array in which to store compressed image
  9640. -------
  9641. Bytes%    number of bytes in the compressed image
  9642.  
  9643. Name  : SCrunchSS            (Screen Crunch, Sized Screen)
  9644. Class : Display
  9645. Level : Any
  9646.  
  9647. This routine is designed to be used in conjunction with ScrSave
  9648. and the other routines which store a text screen in an array.
  9649. It performs a "screen crunch", compressing the original data
  9650. into a new array.  The average result is about 8x smaller than
  9651. the original screen, resulting in a vast savings in memory.
  9652. The compression algorithm is very fast and will not take any
  9653. noticeable amount of time for most purposes.
  9654.  
  9655. Besides saving main memory, this is great for storing screens
  9656. as disk files! The compression will not only make the file(s)
  9657. smaller, but will make disk access faster since there is less
  9658. information to transfer.
  9659.  
  9660. If you only work with 80x25 text screen images, you may find it
  9661. more convenient to use the SCrunch routine instead.
  9662.  
  9663.    SCrunchSS DSeg%, DOfs%, Rows%, Cols%, CSeg%, COfs%, Bytes%
  9664.  
  9665. DSeg%     segment of the original screen image
  9666. DOfs%     offset of the original screen image
  9667. Rows%     rows in original screen image
  9668. Cols%     columns in original screen image
  9669. CSeg%     segment of array in which to store compressed image
  9670. COfs%     offset of array in which to store compressed image
  9671. -------
  9672. Bytes%    number of bytes in the compressed image
  9673.  
  9674. Name  : Sec2Time$            (Seconds to Time)
  9675. Class : Time
  9676. Level : Any
  9677.  
  9678. This routine converts the number of seconds past midnight into
  9679. a time string.
  9680.  
  9681.    TimeSt$ = Sec2Time$(Seconds&)
  9682.  
  9683. Seconds&   number of seconds past midnight
  9684. -------
  9685. TimeSt$    time string (TIME$ format)
  9686.  
  9687. Name  : SetBit               (Set Bit)
  9688. Class : Numeric
  9689. Level : Any
  9690.  
  9691. This routine sets a single bit "on" in an integer.  Bits are
  9692. numbered 0-15, with 0 being the least significant bit.
  9693.  
  9694.    SetBit Number%, BitNr%
  9695.  
  9696. Number%    number for which to set bit
  9697. BitNr%     bit number (0-15) to set
  9698. -------
  9699. Number%    number with the specified bit set
  9700.  
  9701. Name  : SetCGAColor          (Set CGA Color)
  9702. Class : Display
  9703. Level : Clone
  9704.  
  9705. This routine allows you to set certain aspects of CGA colors
  9706. which aren't available otherwise.  It is very CGA-specific,
  9707. however, and may not work on EGA or VGA systems.
  9708.  
  9709. The color specified has different meanings in different CGA
  9710. modes.  In the SCREEN 1 graphics mode, it changes the
  9711. background and border color.  In SCREEN 2, however, it allows
  9712. you to change the foreground color.  While you are still stuck
  9713. with a single foreground color, you can choose what that color
  9714. will be.
  9715.  
  9716.    SetCGAColor Colour%
  9717.  
  9718. Colour%    color to set (see above)
  9719.  
  9720. Name  : SetComm              (Set Comm port)
  9721. Class : Serial
  9722. Level : DOS
  9723.  
  9724. Although QuickBASIC has a fair range of communications support,
  9725. it doesn't do the capabilities of the PC full justice.  It's
  9726. also impossible to change the serial parameters "on the fly"
  9727. without risking disconnection, if BASIC alone is used.  SetComm
  9728. gets around those limitations.  It should be used -after- the
  9729. appropriate comm port is OPENed by BASIC.
  9730.  
  9731. Note that the true upper limits of the comm speed are
  9732. determined by your program and by the hardware being used.
  9733. Some PC/XTs may have trouble with 9,600 bps, for instance.  The
  9734. ability to set the serial port to a high speed doesn't
  9735. guarantee that the hardware can handle it!
  9736.  
  9737.    SetComm CommPort%, Bps%, Parity%, WordLength%, StopBits%
  9738.  
  9739. CommPort%    serial port (1-4, though BASIC only uses 1-2)
  9740. Bps%         bits per second ("baud rate"):
  9741.                 0 for   300       5 for   9,600
  9742.                 1 for   600       6 for  19,200
  9743.                 2 for 1,200       7 for  38,400
  9744.                 3 for 2,400       8 for  57,600
  9745.                 4 for 4,800       9 for 115,200
  9746. Parity%      parity:
  9747.                 0  none
  9748.                 1  odd            3  mark  (always on)
  9749.                 2  even           4  space (always off)
  9750. WordLength%  word length (5-8)
  9751. StopBits%    stop bits (1-2; if WordLength=5, "2" means 1 1/2)
  9752.  
  9753. Name  : SetCommAddr          (Set Comm Address)
  9754. Class : Serial
  9755. Level : Clone
  9756.  
  9757. This routine allows you to set the base port address of a
  9758. serial port.
  9759.  
  9760. One use for SetCommAddr is to give QuickBASIC access to the
  9761. comm port on those unusual machines which have a COM2 but no
  9762. COM1.  Use GetCommAddr to get the address of COM2, set the COM1
  9763. address accordingly, and tell QuickBASIC to use COM1.
  9764.  
  9765. BASIC will normally handle COM1 and COM2, but not COM3 or
  9766. COM4.  Although there is no way to use more two ports at once,
  9767. you can fool BASIC into using COM3 by swapping it with COM1, or
  9768. COM4 by swapping it with COM2.
  9769.  
  9770. Don't forget to set the ports back to their original values
  9771. before your program ends!
  9772.  
  9773.    SetCommAddr PortNr%, PortAddr%
  9774.  
  9775. PortNr%     COM port number (1-4)
  9776. PortAddr%   port address
  9777.  
  9778. Name  : SetDateAT            (Set Date of AT clock)
  9779. Class : Time
  9780. Level : BIOS (AT)
  9781.  
  9782. This routine sets the date of the hardware real-time clock in
  9783. AT-class computers.  Depending on the DOS version, this date
  9784. may be partially or completely independent of the date kept by
  9785. DOS in software.  DOS always reads the date from the hardware
  9786. clock when it starts up.  However, use of the DATE command in
  9787. DOS (and the DATE$ function in QuickBASIC) may relate only to
  9788. the software copy of the date, which is not always guaranteed
  9789. to be the same as the date in the hardware clock due to certain
  9790. discrepancies in DOS.
  9791.  
  9792. You may express the year as either a two-digit or four-digit
  9793. number.
  9794.  
  9795. The ProBas and PBClone versions of this routine do not work the
  9796. same way in regards to the year.  ProBas assumed that any
  9797. two-digit year was in the 1900s.  In contrast, PBClone assumes
  9798. that years 80-99 should be converted to 1980-1999 and that 0-79
  9799. should be converted to 2000-2079.  I consider the PBClone
  9800. method more appropriate, with the turn of the century moving
  9801. closer. The date format used does not allow dates before 1980
  9802. anyway, so nothing is being lost by this change.
  9803.  
  9804.    SetDateAT MonthNr%, DayNr%, YearNr%
  9805.  
  9806. MonthNr%    month number (1-12)
  9807. DayNr%      day (1-31)
  9808. YearNr%     year (1980-2079; see above for two-digit years)
  9809.  
  9810. Name  : SetDrv               (Set default Drive)
  9811. Class : Disk
  9812. Level : DOS
  9813.  
  9814. This routine sets the default disk drive.
  9815.  
  9816. If the specified drive does not exist, the current default
  9817. drive will remain the default.
  9818.  
  9819.    SetDrv Drive$
  9820.  
  9821. Drive$    drive letter
  9822.  
  9823. Name  : SetError             (Set Error code)
  9824. Class : Miscellaneous
  9825. Level : DOS
  9826.  
  9827. The SetError routine allows you to set the "error level" to be
  9828. returned by DOS when your program ends.  This is particularly
  9829. handy for returning information to batch files.
  9830.  
  9831. Note that SetError is best used just before your program ENDs,
  9832. to avoid complications.
  9833.  
  9834.    SetError ErrorLevel%
  9835.  
  9836. ErrorLevel%   exit code to be returned by your program
  9837.  
  9838. Name  : SetFAttr             (Set File Attribute)
  9839. Class : Disk
  9840. Level : DOS
  9841.  
  9842. This routine allows you to set the attribute of a file or
  9843. subdirectory.  Any combination of the following may be set:
  9844.  
  9845.    Normal          0      (nothing special)
  9846.    Read Only       1      file can be read, but not written to
  9847.    Hidden          2      file will be "invisible"
  9848.    System          4      (for special DOS files-- leave alone)
  9849.    Archive        32      (used by some backup utils- leave be)
  9850.  
  9851. To set more than one attribute, just add the numbers for the
  9852. desired attributes together.  The attributes marked "leave
  9853. alone" shouldn't be used casually, but if you're sure you know
  9854. what you're doing...
  9855.  
  9856.    SetFAttr FileName$, FAttr%
  9857.  
  9858. FileName$   name of the file (or subdirectory) to manipulate
  9859. FAttr%      attribute(s) to set
  9860.  
  9861. Name  : SetFTD               (Set File Time and Date)
  9862. Class : Disk
  9863. Level : DOS
  9864.  
  9865. This routine lets you set the time and date of a specified
  9866. file.  You may give the year either as two digits or four
  9867. digits.
  9868.  
  9869. The ProBas and PBClone versions of this routine do not work the
  9870. same way in regards to the year.  ProBas assumed that any
  9871. two-digit year was in the 1900s.  In contrast, PBClone assumes
  9872. that years 80-99 should be converted to 1980-1999 and that 0-79
  9873. should be converted to 2000-2079.  I consider the PBClone
  9874. method more appropriate, with the turn of the century moving
  9875. closer. The DOS date format does not allow dates before 1980
  9876. anyway, so nothing is being lost by this change.
  9877.  
  9878. Note that the Second% value, if odd, will be rounded down to an
  9879. even number. This is due to the way DOS compresses the time
  9880. format, rather than any limitation in this routine.
  9881.  
  9882.    SetFTD File$, MonthNr%, DayNr%, YearNr%, HourNr%, _
  9883.      MinuteNr%, SecondNr%
  9884.  
  9885. File$        name of file for which to set the time and date
  9886. MonthNr%     month number (1-12)
  9887. DayNr%       day (1-31)
  9888. YearNr%      year (1980-2079; see above for two-digit years)
  9889. HourNr%      hour (0-23)
  9890. MinuteNr%    minute (0-59)
  9891. SecondNr%    second (0-59; if odd, rounded down to even number)
  9892. -------
  9893. MonthNr%     -1 if there was an error, else unchanged
  9894.  
  9895. Name  : SetKbd               (Set Keyboard toggles)
  9896. Class : Input
  9897. Level : Clone
  9898.  
  9899. The SetKbd routine allows you to set the state of any of the
  9900. four keyboard toggles: Insert, Caps lock, Num lock, and Scroll
  9901. Lock.  You can give your input routines a professional touch by
  9902. setting this toggles instead of making the user remember to do
  9903. so.
  9904.  
  9905. It's considered proper to restore the original keyboard toggles
  9906. before your program exits, unless of course the purpose of the
  9907. program is to leave the toggles in a particular state!  The
  9908. GetKbd routine can be used in conjunction with SetKbd to do
  9909. this.
  9910.  
  9911.    SetKbd Insert%, Caps%, Num%, Scrl%
  9912.  
  9913. Insert%    whether to turn on "insert" mode (0 if no)
  9914. Caps%      whether to turn on "caps lock" (0 if no)
  9915. Num%       whether to put the keypad into numeric mode (0 no)
  9916. Scrl%      whether to turn on "scroll lock" (0 if no)
  9917.  
  9918. Name  : SetLabel             (Set disk volume Label)
  9919. Class : Disk
  9920. Level : DOS
  9921.  
  9922. This routine creates, renames or deletes a disk volume label.
  9923.  
  9924. Note that a disk volume label is essentially a file name
  9925. without an extension.  It can contain any character that can
  9926. normally be in a file name, plus spaces and periods.
  9927.  
  9928.    SetLabel Drive$, Label$, ErrCode%
  9929.  
  9930. Drive$     drive to set label on (use "" for current drive)
  9931. Label$     label to install (use "" to delete current label)
  9932. -------
  9933. ErrCode%   whether there was an error (0 no)
  9934.  
  9935. Name  : SetLogiDrive         (Set Logical Drive)
  9936. Class : Disk
  9937. Level : DOS 3.2+
  9938.  
  9939. This routine is useful for systems which only have a single
  9940. floppy drive.  In such cases, DOS connects both drive letters
  9941. A: and B: to the same drive.  However, only one drive letter is
  9942. active, and when you try to access the "other" drive, DOS
  9943. displays the message:
  9944.  
  9945.   "Insert diskette for drive x: and press any key when ready."
  9946.  
  9947. By setting the active drive yourself, you can bypass this
  9948. message, and your program will look much more professional.
  9949.  
  9950.    SetLogiDrive Drive$, ErrCode%
  9951.  
  9952. Drive$     drive letter to select (use "" for current drive)
  9953. -------
  9954. ErrCode%   whether there was an error (0 no)
  9955.  
  9956. Name  : SetMatI              (Set Matrix to Integer)
  9957. Class : Numeric
  9958. Level : Any
  9959.  
  9960. This routine sets as many elements of an integer array as you
  9961. like, starting at a specified place in the array.  A good use
  9962. for it is to initialize an array (or a portion of it) to a
  9963. given value.
  9964.  
  9965.    SetMatI DSeg%, DOfs%, Elements%, Value%
  9966.  
  9967. DSeg%      segment of the first array element to add
  9968. DOfs%      offset of the first array element to add
  9969. Elements%  number of array elements to which to add
  9970. Value%     value to which to set each array element
  9971.  
  9972. Name  : SetMatL              (Set Matrix to Long)
  9973. Class : Numeric
  9974. Level : Any
  9975.  
  9976. This routine sets as many elements of an long integer array as
  9977. you like, starting at a specified place in the array.  A good
  9978. use for it is to initialize an array (or a portion of it) to a
  9979. given value.
  9980.  
  9981.    SetMatL DSeg%, DOfs%, Elements%, Value&
  9982.  
  9983. DSeg%      segment of the first array element to add
  9984. DOfs%      offset of the first array element to add
  9985. Elements%  number of array elements to which to add
  9986. Value&     value to which to set each array element
  9987.  
  9988. Name  : SetMouseLoc          (Set Mouse Location)
  9989. Class : Mouse
  9990. Level : BIOS
  9991.  
  9992. This routine allows you to set the current location of the
  9993. mouse cursor.  It doesn't matter if the cursor is visible or
  9994. invisible.  SetMouseLoc is only for use in text mode.
  9995.  
  9996. This routine will not work properly if there is no mouse
  9997. available.  Use the MMCheck routine if you are not sure.
  9998.  
  9999. See also MMSetLoc, which is for use in graphics modes.
  10000.  
  10001.    SetMouseLoc Row%, Column%
  10002.  
  10003. Row%       mouse cursor row
  10004. Column%    mouse cursor column
  10005.  
  10006. Name  : SetPatch             (Set Patch information)
  10007. Class : Disk
  10008. Level : DOS
  10009.  
  10010. This routine is used after FindPatch.  The FindPatch routine
  10011. finds the first DATA statement to be patched.  SetPatch places
  10012. new information in that DATA statement and moves the file
  10013. pointer to the position of the next DATA statement.  Note that
  10014. there must be only one item per DATA statement; this item must
  10015. be a quoted string.  The string in the DATA statement and the
  10016. patch string must be the same length.
  10017.  
  10018. If you need this routine to be able to handle variable-length
  10019. strings, don't fret!  Make the DATA string one character longer
  10020. than the maximum you need, and use the extra character to
  10021. indicate the actual string length:
  10022.    SetPatch CHR$(LEN(St$)) + St$
  10023. Then when you READ St$, decode it like so:
  10024.    St$ = MID$(St$, 2, ASC(St$))
  10025.  
  10026. Routines in this set include FindPatch, SetPatch, PatchDone.
  10027.  
  10028.    SetPatch St$
  10029.  
  10030. St$       string to patch into the current DATA statement
  10031.  
  10032. Name  : SetPrtAddr           (Set Printer Address)
  10033. Class : Printer
  10034. Level : Clone
  10035.  
  10036. This routine allows you to set the base port address of a
  10037. parallel port.
  10038.  
  10039. One use for this routine is to fool BASIC into using a
  10040. different port than LPT1 for LPRINT.  See also PRTSWAP.
  10041.  
  10042. Note that PS/2 systems only have ports 1-3 available.  They use
  10043. the fourth port data area for holding other information.  It
  10044. may be a good idea to restrict yourself to ports 1-3 for
  10045. compatibility purposes, although other computers allow ports
  10046. 1-4.
  10047.  
  10048. Don't forget to set the ports back to their original values
  10049. before your program ends!
  10050.  
  10051.    SetPrtAddr PortNr%, PortAddr%
  10052.  
  10053. PortNr%     LPT port number (1-4 or 1-3 [see above])
  10054. PortAddr%   port address
  10055.  
  10056. Name  : SetSub               (Set default Subdirectory)
  10057. Class : Disk
  10058. Level : DOS
  10059.  
  10060. Just like the DOS CD (or CHDIR) command, this routine allows
  10061. you to change the current subdirectory.  Unlike the
  10062. corresponding DOS command, you may not use a period or double
  10063. period as shorthand for a directory.  However, you may specify
  10064. either an absolute or relative path, as usual, and can also use
  10065. either slashes or backslashes as delimiters.
  10066.  
  10067.    SetSub SubDir$, ErrCode%
  10068.  
  10069. SubDir$    subdirectory name
  10070. -------
  10071. ErrCode%   error code: 0 if no error, else a DOS Error number
  10072.  
  10073. Name  : SetTimeAT            (Set Time of AT clock)
  10074. Class : Time
  10075. Level : BIOS (AT)
  10076.  
  10077. This routine sets the time to the hardware real-time clock in
  10078. AT-class computers.  Depending on the DOS version, this time
  10079. may be partially or completely independent of the time kept by
  10080. DOS in software.  DOS always reads the time from the hardware
  10081. clock when it starts up.  However, use of the TIME command in
  10082. DOS (and the TIME$ function in QuickBASIC) may relate only to
  10083. the software copy of the time, which is not always guaranteed
  10084. to be the same as the time in the hardware clock due to certain
  10085. discrepancies in DOS.
  10086.  
  10087.    SetTimeAT HourNr%, MinuteNr%, SecondNr%
  10088.  
  10089. HourNr%      hour (0-23)
  10090. MinuteNr%    minute
  10091. SecondNr%    second
  10092.  
  10093. Name  : SetVerify            (Set Verify state)
  10094. Class : Disk
  10095. Level : DOS
  10096.  
  10097. The SetVerify routine allows you to set the state of the DOS
  10098. VERIFY flag. When VERIFY is on, some checking is done to make
  10099. sure that writing to the disk works as requested.  The checks
  10100. are not very good, however, and VERIFY slows down disk
  10101. handling, so it is usually better to have VERIFY off.
  10102.  
  10103.    SetVerify VerifyOn%
  10104.  
  10105. VerifyOn%   whether to turn VERIFY on (0 if no)
  10106.  
  10107. Name  : SetVGAColor          (Set VGA Color)
  10108. Class : Display
  10109. Level : BIOS
  10110.  
  10111. This routine sets the color associated with a given color
  10112. number.  The color is specified as a combination of red, green,
  10113. and blue intensities.  Each intensity may range from off (0) to
  10114. very bright (63).
  10115.  
  10116. If you are dealing with more than one color at a time, you may
  10117. find SetVGAPalette more appropriate.
  10118.  
  10119.    SetVGAColor ColorNr%, Red%, Green%, Blue%
  10120.  
  10121. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  10122. Red%       red intensity (0-63)
  10123. Green%     green intensity (0-63)
  10124. Blue%      blue intensity (0-63)
  10125.  
  10126. Name  : SetVGAPalette        (Set VGA Palette)
  10127. Class : Display
  10128. Level : BIOS
  10129.  
  10130. This routine allows you to set any number of the VGA palette
  10131. values from a TYPEd array.  The TYPE for the array should be
  10132. defined like this:
  10133.  
  10134.    TYPE Palet
  10135.       IRed AS STRING * 1
  10136.       IBlue AS STRING * 1
  10137.       IGreen AS STRING * 1
  10138.    END TYPE
  10139.  
  10140. This type holds a CHR$-encoded representation of the intensity
  10141. of each component of the color.  The values range from 0-63.
  10142.  
  10143. You can change many palette settings at a time, very quickly,
  10144. with this routine.  This routine is sufficiently faster than
  10145. the BASIC PALETTE statement as to make palette animation (and
  10146. some stupendous special effects) possible.  It may cause
  10147. flickering on displays with less well-designed video BIOS
  10148. chips, however.
  10149.  
  10150. If you only need to set a few colors, you may find SetVGAColor
  10151. more convenient.
  10152.  
  10153.    SetVGAPalette DSeg%, DOfs%, Start%, Colors%
  10154.  
  10155. DSeg%      segment of the palette array
  10156. DOfs%      offset of the palette array
  10157. Start%     color number to start with
  10158. Colors%    number of colors to set
  10159.  
  10160. Name  : SFRead               (String File Read)
  10161. Class : Disk / String
  10162. Level : DOS
  10163.  
  10164. This routine reads a string from a file that was opened by
  10165. FOpen1 or FCreate. The length of the string you provide
  10166. determines how many characters should be read.  If it wasn't
  10167. possible to read all the characters desired, an error code will
  10168. be returned and the BytesRead% value will tell you how many
  10169. characters were actually retrieved.
  10170.  
  10171.    St$ = SPACE$(BytesToRead%)
  10172.    SFRead Handle%, St$, BytesRead%, ErrCode%
  10173.  
  10174. Handle%     handle of the file from which to read
  10175. -------
  10176. St$         data read from the file.  Init to # of chars wanted
  10177. BytesRead%  number of bytes read from the file (if error)
  10178. ErrCode%    error code: 0 if no error, else DOS Error
  10179.  
  10180. Name  : SFWrite              (String File Write)
  10181. Class : Disk / String
  10182. Level : DOS
  10183.  
  10184. This routine writes a string to a file that was opened by
  10185. FOpen1 or FCreate.  The length of the string you provide
  10186. determines how many characters will be written.  If it wasn't
  10187. possible to write the entire string to the file, an error code
  10188. will be returned and the BytesWrit% value will tell you how
  10189. many characters were actually written.
  10190.  
  10191.    SFWrite Handle%, St$, BytesWrit%, ErrCode%
  10192.  
  10193. Handle%     handle of the file to which to write
  10194. St$         data to write to the file.
  10195. -------
  10196. BytesWrit%  number of bytes written to the file (if error)
  10197. ErrCode%    error code: 0 if no error, else DOS Error
  10198.  
  10199. Name  : ShiftL               (Shift Left)
  10200. Class : Numeric
  10201. Level : Any
  10202.  
  10203. This routine shifts the bits in an integer left by a desired
  10204. amount.  The effect of this is similar to multiplying the
  10205. number by a power of two, if the number is positive, but is
  10206. much faster.
  10207.  
  10208.    ShiftL Value%, Count%
  10209.  
  10210. Value%    number to shift left
  10211. Count%    bits by which to shift
  10212. -------
  10213. Value%    shifted number
  10214.  
  10215. Name  : ShiftLL              (Shift Left Long)
  10216. Class : Numeric
  10217. Level : Any
  10218.  
  10219. This routine shifts the bits in a long integer left by a
  10220. desired amount.  The effect of this is similar to multiplying
  10221. the number by a power of two, if the number is positive, but is
  10222. much faster.
  10223.  
  10224.    ShiftLL Value&, Count%
  10225.  
  10226. Value&    number to shift left
  10227. Count%    bits by which to shift
  10228. -------
  10229. Value&    shifted number
  10230.  
  10231. Name  : ShiftR               (Shift Right)
  10232. Class : Numeric
  10233. Level : Any
  10234.  
  10235. This routine shifts the bits in an integer right by a desired
  10236. amount.  The effect of this is similar to dividing the number
  10237. by a power of two, if the number is positive, but is much
  10238. faster.
  10239.  
  10240.    ShiftR Value%, Count%
  10241.  
  10242. Value%    number to shift right
  10243. Count%    bits by which to shift
  10244. -------
  10245. Value%    shifted number
  10246.  
  10247. Name  : ShiftRL              (Shift Right Long)
  10248. Class : Numeric
  10249. Level : Any
  10250.  
  10251. This routine shifts the bits in a long integer right by a
  10252. desired amount. The effect of this is similar to dividing the
  10253. number by a power of two, if the number is positive, but is
  10254. much faster.
  10255.  
  10256.    ShiftRL Value&, Count%
  10257.  
  10258. Value&    number to shift right
  10259. Count%    bits by which to shift
  10260. -------
  10261. Value&    shifted number
  10262.  
  10263. Name  : ShlSt                (Shift Left String of bits)
  10264. Class : String
  10265. Level : Any
  10266.  
  10267. This routine shifts the bits in a string left by a desired
  10268. amount.  This may be helpful for manupulating strings
  10269. containing bit flags, images, et al.
  10270.  
  10271.    ShlSt St$, Count%
  10272.  
  10273. St$       string to shift left
  10274. Count%    bits by which to shift
  10275. -------
  10276. St$       shifted string
  10277.  
  10278. Name  : ShowIcon             (Show Icon)
  10279. Class : Display File
  10280. Level : BIOS
  10281.  
  10282. This routine displays an icon file (MS Windows .ICO format) on
  10283. the screen.  The display mode may be any of the EGA or VGA
  10284. graphics modes, and you can specify a starting X,Y coordinate.
  10285.  
  10286. Only the standard icon format is supported.  These icons are
  10287. 32x32 pixels and are contained in 766-byte .ICO files.  Note
  10288. that colors are translated from Windows colors, which are a
  10289. close (but not exact) match for BASIC colors.
  10290.  
  10291.    ShowIcon FileName$, X%, Y%, ErrCode%
  10292.  
  10293. FileName$   name of icon file
  10294. X%          X coordinate (0-320 or 0-640 depending on mode)
  10295. Y%          Y coordinate (0-199, -349, etc; depends on mode)
  10296. -------
  10297. ErrCode%    error code (0 if none; >0, DOS error; <0, not .ICO)
  10298.  
  10299. Name  : ShrSt                (Shift Right String of bits)
  10300. Class : String
  10301. Level : Any
  10302.  
  10303. This routine shifts the bits in a string right by a desired
  10304. amount.  This may be helpful for manupulating strings
  10305. containing bit flags, images, et al.
  10306.  
  10307.    ShrSt St$, Count%
  10308.  
  10309. St$       string to shift right
  10310. Count%    bits by which to shift
  10311. -------
  10312. St$       shifted string
  10313.  
  10314. Name  : SInput               (String Input)
  10315. Class : Input
  10316. Level : Clone
  10317.  
  10318. This is a flexible line input routine which supports WordStar
  10319. and DOS-style editing, default entries, key screening, and any
  10320. number of other options.  To keep SInput manageable, the less
  10321. volatile parameters are set with separate routines instead of
  10322. being passed directly.
  10323.  
  10324. The St$ parameter must be set to the maximum desired input
  10325. length.  It may also contain a default entry, in which case
  10326. SLen% should be set to the length of the default entry (set
  10327. SLen% to zero if there is no default entry).
  10328.  
  10329. Character screening is done through selection of valid
  10330. character types.  This may be any combination of the following
  10331. (add the desired types together):
  10332.  
  10333.     1    letters
  10334.     2    digits
  10335.     4    symbols
  10336.    16    graphics (ASCII 128-255)
  10337.    32    spaces
  10338.  
  10339. You can use -1 to allow any character.  You can also make use
  10340. of the NOT operator, e.g. NOT 2 allows everything but digits.
  10341.  
  10342. The ExitCode% returns the key used to terminate input.  This
  10343. will normally be 13 (return) or 27 (esc), but other results may
  10344. be returned depending on how you use the various SInputSet
  10345. routines.  Note that the cursor position is not altered when
  10346. SInput exits, to avoid accidentally scrolling your screen.  You
  10347. are left with full control over the cursor.
  10348.  
  10349. The SInput routine is designed with the idea of input forms and
  10350. windows in mind.  It is not capable of handling more than one
  10351. line of text at a time. It also doesn't know how to wrap at the
  10352. edge of the screen.
  10353.  
  10354. Routines in this series include:
  10355.    SInput, SInputSet, SInputSet1, SInputSet2
  10356.  
  10357. Since everyone has their own ideas about the perfect input
  10358. routine, I have recoded SInput largely in BASIC to allow
  10359. registered PBClone owners to modify it easily.  I've gotten a
  10360. huge number of requests for SInput modifications in the past;
  10361. hopefully this will be the best solution!
  10362.  
  10363.    SInput St$, SLen%, Valid%, MustFill%, VAttr%, ExitCode%
  10364.  
  10365. St$         init to max length of input (may hold default)
  10366. SLen%       length of default entry (0 if none)
  10367. Valid%      valid character types (see above)
  10368. MustFill%   whether input field must be totally filled (0 no)
  10369. VAttr%      color/attribute for input (see CalcAttr)
  10370. -------
  10371. St$         entered string
  10372. SLen%       length of entered string
  10373. ExitCode%   key used to exit (13 for <CR> or 27 for <ESC>)
  10374.  
  10375. Name  : SInputSet            (String Input Settings)
  10376. Class : Input
  10377. Level : Clone
  10378.  
  10379. This is one of a number of routines which allow you to modify
  10380. the default operation of SInput.
  10381.  
  10382. If you allow extended keys (like Alt keys and function keys) to
  10383. exit SInput, the ExitCode% parameter will return the negative
  10384. scan code of the key.
  10385.  
  10386. Routines in this series include:
  10387.    SInput, SInputSet, SInputSet1, SInputSet2
  10388.  
  10389.    SInputSet FillCh$, ExtExit%, BadBeep%, FullBeep%, Fast%
  10390.  
  10391. FillCh$     character used to show field length (default "_")
  10392. ExtExit%    extended keys can be used to exit (default 0, no)
  10393. BadBeep%    beep on invalid keys (default 0, no)
  10394. FullBeep%   beep when input field is full (default 0, no)
  10395. Fast%       use fast display, may make CGA flicker (def 0, no)
  10396.  
  10397. Name  : SInputSet1           (String Input Settings)
  10398. Class : Input
  10399. Level : Clone
  10400.  
  10401. This is one of a number of routines which allow you to modify
  10402. the default operation of SInput.
  10403.  
  10404. If you give SInput a default entry, it will normally place the
  10405. cursor at the end of that entry when input begins.  The
  10406. CurPosn% option here allows you to place the cursor where you
  10407. want it (1 - LEN(St$), or 0 for end of entry).
  10408.  
  10409. Routines in this series include:
  10410.    SInput, SInputSet, SInputSet1, SInputSet2
  10411.  
  10412.    SInputSet1 CurPosn%, FullExit%
  10413.  
  10414. CurPosn%    starting cursor posn within input field (default 0)
  10415. FullExit%   auto-exit when input field is full (default 0, no)
  10416.  
  10417. Name  : SInputSet2           (String Input Settings)
  10418. Class : Input
  10419. Level : Clone
  10420.  
  10421. This is one of a number of routines which allow you to modify
  10422. the default operation of SInput.
  10423.  
  10424. If you allow tabs to exit SInput, the ExitCode% may return an
  10425. additional value: 9 (tab).  A "back tab", by the way, can be
  10426. retrieved if you use SInputSet to allow extended keys to exit
  10427. (back tab would return -15).
  10428.  
  10429. Routines in this series include:
  10430.    SInput, SInputSet, SInputSet1, SInputSet2
  10431.  
  10432.    SInputSet2 Capitalize%, TabExit%
  10433.  
  10434. Capitalize%   whether to capitalize letters (default 0, no)
  10435. TabExit%      whether tab key can to exit (default 0, no)
  10436.  
  10437. Name  : SortD                (Sort Double precision)
  10438. Class : Array management
  10439. Level : Any
  10440.  
  10441. This routine sorts the elements in an array of double-precision
  10442. numbers.
  10443.  
  10444. The array is assumed to start at element 1.  You may specify
  10445. the last element in the array, allowing you to sort only part
  10446. of an array if you like.
  10447.  
  10448. If you would like the results to be largest-to-smallest, rather
  10449. than smallest-to-largest, just call ReverseD after this routine.
  10450.  
  10451.    SortD Array#(), Elements%
  10452.  
  10453. Array#()    array to be sorted
  10454. Elements%   number of elements in array
  10455. -------
  10456. Array#()    sorted array
  10457.  
  10458. Name  : SortI                (Sort Integer)
  10459. Class : Array management
  10460. Level : Any
  10461.  
  10462. This routine sorts the elements in an array of integers.
  10463.  
  10464. The array is assumed to start at element 1.  You may specify
  10465. the last element in the array, allowing you to sort only part
  10466. of an array if you like.
  10467.  
  10468. If you would like the results to be largest-to-smallest, rather
  10469. than smallest-to-largest, just call ReverseI after this routine.
  10470.  
  10471.    SortI Array%(), Elements%
  10472.  
  10473. Array%()    array to be sorted
  10474. Elements%   number of elements in array
  10475. -------
  10476. Array%()    sorted array
  10477.  
  10478. Name  : SortL                (Sort Long integer)
  10479. Class : Array management
  10480. Level : Any
  10481.  
  10482. This routine sorts the elements in an array of long integers.
  10483.  
  10484. The array is assumed to start at element 1.  You may specify
  10485. the last element in the array, allowing you to sort only part
  10486. of an array if you like.
  10487.  
  10488. If you would like the results to be largest-to-smallest, rather
  10489. than smallest-to-largest, just call ReverseL after this routine.
  10490.  
  10491.    SortL Array&(), Elements%
  10492.  
  10493. Array&()    array to be sorted
  10494. Elements%   number of elements in array
  10495. -------
  10496. Array&()    sorted array
  10497.  
  10498. Name  : SortS                (Sort Single precision)
  10499. Class : Array management
  10500. Level : Any
  10501.  
  10502. This routine sorts the elements in an array of single-precision
  10503. numbers.
  10504.  
  10505. The array is assumed to start at element 1.  You may specify
  10506. the last element in the array, allowing you to sort only part
  10507. of an array if you like.
  10508.  
  10509. If you would like the results to be largest-to-smallest, rather
  10510. than smallest-to-largest, just call ReverseS after this routine.
  10511.  
  10512.    SortS Array!(), Elements%
  10513.  
  10514. Array!()    array to be sorted
  10515. Elements%   number of elements in array
  10516. -------
  10517. Array!()    sorted array
  10518.  
  10519. Name  : SortSt               (Sort String)
  10520. Class : Array management
  10521. Level : Any
  10522.  
  10523. This routine sorts the elements in a string array.
  10524.  
  10525. The array is assumed to start at element 1.  You may specify
  10526. the last element in the array, allowing you to sort only part
  10527. of an array if you like.  You can also specify whether the
  10528. capitalization of letters in a string should matter for sorting
  10529. purposes.
  10530.  
  10531. If you would like the results to be last-to-first, rather than
  10532. first-to-last, just call ReverseSt after this routine.
  10533.  
  10534.    SortSt Array$(), Elements%, CapsCount%
  10535.  
  10536. Array$()    array to be sorted
  10537. CapsCount%  use 0 if uppercase/lowercase doesn't matter
  10538. Elements%   number of elements in array
  10539. -------
  10540. Array$()    sorted array
  10541.  
  10542. Name  : Soundex              (Soundex code)
  10543. Class : String
  10544. Level : Any
  10545.  
  10546. This is a string comparison routine which returns a code that
  10547. is loosely based on the "sound" of a word.  It removes the
  10548. vowels and repeated characters from a word, then converts it
  10549. into a numeric code.  Any words with the same code are
  10550. considered to sound alike.
  10551.  
  10552. While not perfect, this algorithm does a fast and reasonably
  10553. good job.  It can be helpful in applications like spelling
  10554. checkers and phone books, where a search based on exact text
  10555. may not be appropriate.
  10556.  
  10557.    Code$ = St$
  10558.    Soundex St$, Code$, CodeLen%
  10559.    Code$ = LEFT$(St$, CodeLen%)
  10560.  
  10561. St$       string to be encoded
  10562. -------
  10563. Code$     result code.  Init to >= length of original string.
  10564. CodeLen%  length of the result code
  10565.  
  10566. Name  : SpeedKey             (Speed up Keyboard)
  10567. Class : Input
  10568. Level : BIOS (AT)
  10569.  
  10570. This routine provides control over the keyboard repeat rate for
  10571. AT-class machines.  Increasing the repeat rate can make the
  10572. computer seem a lot more responsive and pleasant to deal with.
  10573.  
  10574.   RepDelay%   Delay Time
  10575.      0        250 milliseconds
  10576.      1        500 ms
  10577.      2        750 ms
  10578.      3        1 second
  10579.  
  10580.   RepRate% is the key repeat rate, 0-31 (from around 30 cps to
  10581.   around 2 cps)
  10582.  
  10583.    SpeedKey RepDelay%, RepRate%
  10584.  
  10585. RepDelay%   delay before starting to repeat (0-3, default 1)
  10586. RepRate%    rate at which to repeat key (0-31, default 11)
  10587.  
  10588. Name  : Split                (Split screen image)
  10589. Class : Display
  10590. Level : Clone
  10591.  
  10592. This provides an elegant way to clear a text-mode screen.  It
  10593. splits the display into four parts, scrolling each part up or
  10594. down until it slides off the screen.
  10595.  
  10596.    Split
  10597.  
  10598. Name  : Spooler              (check for print Spooler)
  10599. Class : Printer
  10600. Level : DOS
  10601.  
  10602. The Spooler routine allows you to see whether the print spooler
  10603. (installed by the DOS PRINT utility) is available.
  10604.  
  10605.    Spooler Status%
  10606.  
  10607. -------
  10608. Status%   spooler status:
  10609.              -1   it's installed
  10610.               0   it isn't installed, but can be
  10611.               1   it isn't installed, and can't be
  10612.  
  10613. Name  : SSrch                (String Search)
  10614. Class : String
  10615. Level : Any
  10616.  
  10617. This is a string search routine which tells you whether one
  10618. string can be found inside another.  Uppercase/lowercase
  10619. distinctions are ignored.  Leading and trailing spaces in the
  10620. string for which to search are also ignored.
  10621.  
  10622. Note that the positions of the main string and search string
  10623. parameters are in the reverse of the order you might expect.
  10624.  
  10625.    SSrch Search$, MainSt$, Found%
  10626.  
  10627. Search$   string for which to search
  10628. MainSt$   string to be searched
  10629. -------
  10630. Found%    whether a match was found (0 if no)
  10631.  
  10632. Name  : StrDel               (String Delete)
  10633. Class : String
  10634. Level : Any
  10635.  
  10636. StrDel deletes a character from a string.  Actually, it doesn't
  10637. make the string any shorter, but it acts like a delete.  The
  10638. end of the string is filled with a space.
  10639.  
  10640.    StrDel St$, Posn%
  10641.  
  10642. St$       string from which to delete a character
  10643. Posn%     position of the character to delete (1-LEN(St$))
  10644. -------
  10645. St$       processed string
  10646.  
  10647. Name  : StrIns               (String Insert)
  10648. Class : String
  10649. Level : Any
  10650.  
  10651. StrIns inserts a space into a string.  Actually, it doesn't
  10652. make the string any longer, but it acts like an insert.  The
  10653. former end of the string is discarded.
  10654.  
  10655.    StrIns St$, Posn%
  10656.  
  10657. St$       string in which to insert a space
  10658. Posn%     where to insert the space (1-LEN(St$))
  10659. -------
  10660. St$       processed string
  10661.  
  10662. Name  : Strip                (Strip spaces)
  10663. Class : String
  10664. Level : Any
  10665.  
  10666. This routine strips both leading and trailing white space from
  10667. a string. This includes control characters as well as blanks
  10668. (anything below CHR$(33)).
  10669.  
  10670.    Strip St$
  10671.  
  10672. St$      string to process
  10673. -------
  10674. St$      processed string
  10675.  
  10676. Name  : Strip2$              (Strip Spaces)
  10677. Class : String
  10678. Level : Any
  10679.  
  10680. This routine strips both leading and trailing white space from
  10681. a string.  It works just like Strip, but is a function rather
  10682. than a subprogram.  White space includes control characters as
  10683. well as blanks (anything below CHR$(33)).
  10684.  
  10685.    Result$ = Strip2$(St$)
  10686.  
  10687. St$       string to process
  10688. -------
  10689. Result$   processed string
  10690.  
  10691. Name  : StripBlanks          (Strip Blanks)
  10692. Class : String
  10693. Level : Any
  10694.  
  10695. This routine strips leading and/or trailing white space from a
  10696. string.  This includes control characters as well as blanks
  10697. (anything below CHR$(33)).
  10698.  
  10699. See also StripSpaces.
  10700.  
  10701.    StripBlanks St$, Which%, StLen%
  10702.    St$ = LEFT$(St$, StLen%)
  10703.  
  10704. St$      string to process
  10705. Which%   1: strip left, 2: strip right, 3: strip left and right
  10706. -------
  10707. St$      processed string
  10708. StLen    length of processed string
  10709.  
  10710. Name  : StripChar            (Strip Characters)
  10711. Class : String
  10712. Level : Any
  10713.  
  10714. This routine strips all occurrences of a given list of
  10715. characters out of a string.  Among the uses for this are
  10716. cleaning up user-entered values.  For instance, a strip list of
  10717. "$," would remove commas and dollar signs from a number, and
  10718. "()- " will remove telephone delimiters.
  10719.  
  10720.    StripChar St$, StripList$, StLen%
  10721.    St$ = LEFT$(St$, StLen%)
  10722.  
  10723. St$         string to process
  10724. StripList$  characters to remove from the string
  10725. -------
  10726. St$         processed string
  10727. StLen%      length of processed string
  10728.  
  10729. Name  : StripRange           (Strip Range of characters)
  10730. Class : String
  10731. Level : Any
  10732.  
  10733. This routine strips an inclusive range of characters out of a
  10734. string.  The range is specified as the first and last ASCII
  10735. codes to strip.  For instance, using a low character of "0" and
  10736. a high of "9" would remove all digits from a string.
  10737.  
  10738.    StripRange St$, ASC(LowChar$), ASC(HighChar$), StLen%
  10739.    St$ = LEFT$(St$, StLen%)
  10740.  
  10741. St$         string to process
  10742. LowChar$    lowest character to strip
  10743. HighChar$   highest character to strip
  10744. -------
  10745. St$         processed string
  10746. StLen%      length of processed string
  10747.  
  10748. Name  : StripSpaces          (Strip Spaces)
  10749. Class : String
  10750. Level : Any
  10751.  
  10752. This routine strips leading and/or trailing spaces from a
  10753. string.
  10754.  
  10755. See also StripBlanks.
  10756.  
  10757.    StripSpaces St$, Which%, StLen%
  10758.    St$ = LEFT$(St$, StLen%)
  10759.  
  10760. St$      string to process
  10761. Which%   1: strip left, 2: strip right, 3: strip left and right
  10762. -------
  10763. St$      processed string
  10764. StLen%   length of processed string
  10765.  
  10766. Name  : StrSqu$              (String Squish)
  10767. Class : String
  10768. Level : Any
  10769.  
  10770. This is a text compression routine which uses 2-gram and 3-gram
  10771. compression to shrink a string.  It combines the best of the
  10772. StrSqu2 and StrSqu3 routines with additional ease of use. The
  10773. one limitation is that only plain text may be compressed; the
  10774. text may not contain CHR$(128) through CHR$(255), as these
  10775. codes are used by the compression algorithm.
  10776.  
  10777. The compressed text can be restored to original form with the
  10778. StrUnsq$ function.
  10779.  
  10780.    Result$ = StrSqu$(St$)
  10781.  
  10782. St$       string to compress
  10783. -------
  10784. Result$   compressed string
  10785.  
  10786. Name  : StrSqu2              (String Squish, 2-gram)
  10787. Class : String
  10788. Level : Any
  10789.  
  10790. This is a text compression routine which uses a 2-gram
  10791. algorithm to compress common pairs of characters out of a
  10792. string.  You can reasonably expect to reduce the text size by
  10793. about a third with this routine.  Compression is quite fast.
  10794. The one limitation is that only plain text may be compressed;
  10795. the text may not contain CHR$(128) through CHR$(255), as these
  10796. codes are used by the compression algorithm.
  10797.  
  10798. You must use StrSquLen2 before this routine to determine the
  10799. proper length to which to initialize the result string.
  10800.  
  10801. The compressed text can be restored to original form with
  10802. StrUnsqu2.
  10803.  
  10804.    StrSquLen2 St$, ResultLen%
  10805.    Result$ = SPACE$(ResultLen%)
  10806.    StrSqu2 St$, Result$
  10807.  
  10808. St$       string to compress
  10809. -------
  10810. Result$   compressed string
  10811.  
  10812. Name  : StrSqu3              (String Squish, 3-gram)
  10813. Class : String
  10814. Level : Any
  10815.  
  10816. This is a text compression routine which uses a 3-gram
  10817. algorithm to compress common triplets of characters out of a
  10818. string.  You can reasonably expect to reduce the text size by
  10819. about a third with this routine.  Compression is quite fast.
  10820. The one limitation is that only plain text may be compressed;
  10821. the text may not contain CHR$(128) through CHR$(255), as these
  10822. codes are used by the compression algorithm.
  10823.  
  10824. You must use StrSquLen3 before this routine to determine the
  10825. proper length to which to initialize the result string.
  10826.  
  10827. The compressed text can be restored to original form with
  10828. StrUnsqu3.
  10829.  
  10830.    StrSquLen3 St$, ResultLen%
  10831.    Result$ = SPACE$(ResultLen%)
  10832.    StrSqu3 St$, Result$
  10833.  
  10834. St$       string to compress
  10835. -------
  10836. Result$   compressed string
  10837.  
  10838. Name  : StrSquLen2           (String Squished Length, 2-gram)
  10839. Class : String
  10840. Level : Any
  10841.  
  10842. This routine is used in conjunction with the StrSqu2 text
  10843. compressor. It tells you what size the resulting text will be.
  10844. See StrSqu2 for further information.
  10845.  
  10846.    StrSquLen2 St$, ResultLen%
  10847.    Result$ = SPACE$(ResultLen%)
  10848.    StrSqu2 St$, Result$
  10849.  
  10850. St$          string to compress
  10851. -------
  10852. ResultLen%   length of the compressed string
  10853.  
  10854. Name  : StrSquLen3           (String Squished Length, 3-gram)
  10855. Class : String
  10856. Level : Any
  10857.  
  10858. This routine is used in conjunction with the StrSqu3 text
  10859. compressor. It tells you what size the resulting text will be.
  10860. See StrSqu3 for further information.
  10861.  
  10862.    StrSquLen3 St$, ResultLen%
  10863.    Result$ = SPACE$(ResultLen%)
  10864.    StrSqu3 St$, Result$
  10865.  
  10866. St$          string to compress
  10867. -------
  10868. ResultLen%   length of the compressed string
  10869.  
  10870. Name  : StrUnsq$             (String Unsquish)
  10871. Class : String
  10872. Level : Any
  10873.  
  10874. This routine decompresses text which was compressed by the
  10875. StrSqu$ function.
  10876.  
  10877.    Result$ = StrUnsq$(St$)
  10878.  
  10879. St$       string to decompress
  10880. -------
  10881. Result$   decompressed string
  10882.  
  10883. Name  : StrUnsqu2            (String Unsquish, 2-gram)
  10884. Class : String
  10885. Level : Any
  10886.  
  10887. This routine decompresses text which was compressed by
  10888. StrSqu2.  Text is decompressed at lightning speed, as this
  10889. routine has no overhead to speak of.
  10890.  
  10891. You must use StrUnsquLen2 before this routine to determine the
  10892. proper length to which to initialize the result string.
  10893.  
  10894.    StrUnsquLen2 St$, ResultLen%
  10895.    Result$ = SPACE$(ResultLen%)
  10896.    StrUnsqu2 St$, Result$
  10897.  
  10898. St$       string to decompress
  10899. -------
  10900. Result$   decompressed string
  10901.  
  10902. Name  : StrUnsqu3            (String Unsquish, 3-gram)
  10903. Class : String
  10904. Level : Any
  10905.  
  10906. This routine decompresses text which was compressed by
  10907. StrSqu3.  Text is decompressed at lightning speed, as this
  10908. routine has no overhead to speak of.
  10909.  
  10910. You must use StrUnsquLen3 before this routine to determine the
  10911. proper length to which to initialize the result string.
  10912.  
  10913.    StrUnsquLen3 St$, ResultLen%
  10914.    Result$ = SPACE$(ResultLen%)
  10915.    StrUnsqu3 St$, Result$
  10916.  
  10917. St$       string to decompress
  10918. -------
  10919. Result$   decompressed string
  10920.  
  10921. Name  : StrUnsquLen2         (String Unsquished Length, 2-gram)
  10922. Class : String
  10923. Level : Any
  10924.  
  10925. This routine is used in conjunction with the StrUnsqu2 text
  10926. decompressor. It tells you what size the resulting text will
  10927. be.  See StrUnsqu2 for further information.
  10928.  
  10929.    StrUnsquLen2 St$, ResultLen%
  10930.    Result$ = SPACE$(ResultLen%)
  10931.    StrUnsqu2 St$, Result$
  10932.  
  10933. St$          string to decompress
  10934. -------
  10935. ResultLen%   length of the decompressed string
  10936.  
  10937. Name  : StrUnsquLen3         (String Unsquished Length, 3-gram)
  10938. Class : String
  10939. Level : Any
  10940.  
  10941. This routine is used in conjunction with the StrUnsqu3 text
  10942. decompressor. It tells you what size the resulting text will
  10943. be.  See StrUnsqu3 for further information.
  10944.  
  10945.    StrUnsquLen3 St$, ResultLen%
  10946.    Result$ = SPACE$(ResultLen%)
  10947.    StrUnsqu3 St$, Result$
  10948.  
  10949. St$          string to decompress
  10950. -------
  10951. ResultLen%   length of the decompressed string
  10952.  
  10953. Name  : SubExist             (Subdirectory Existence)
  10954. Class : Disk
  10955. Level : DOS
  10956.  
  10957. This routine lets you see if a given drive and/or subdirectory
  10958. actually exists.
  10959.  
  10960. See also SubExist2, the FUNCTION version of this routine.
  10961.  
  10962.    SubExist SubDir$, Found%
  10963.  
  10964. SubDir$   name of the path to check
  10965. -------
  10966. Found%    whether the path exists (0 if no, -1 if yes)
  10967.  
  10968. Name  : SubExist2%           (Subdirectory Existence)
  10969. Class : Disk
  10970. Level : DOS
  10971.  
  10972. This routine lets you see if a given drive and/or subdirectory
  10973. actually exists.
  10974.  
  10975. See also SubExist, the SUB version of this routine.
  10976.  
  10977.    Found% = SubExist2%(SubDir$)
  10978.  
  10979. SubDir$   name of the path to check
  10980. -------
  10981. Found%    whether the path exists (0 if no, -1 if yes)
  10982.  
  10983. Name  : Time2Int             (Time to Integer)
  10984. Class : Time
  10985. Level : Any
  10986.  
  10987. This routine compresses a time into a single integer.  Note
  10988. that this integer is not in a format that lends itself to
  10989. simple computation-- you cannot subtract one from another to
  10990. find out the length of time between them.  If that's what you
  10991. want, try the Elapsed routine.
  10992.  
  10993. Note that odd numbers of seconds will be rounded down to the
  10994. previous even number.  This is a result of the storage format
  10995. used.
  10996.  
  10997.    Time2Int HourNr%, MinuteNr%, SecondNr%, IntTimeNr%
  10998.  
  10999. HourNr%      hour (0-23)
  11000. MinuteNr%    minute
  11001. SecondNr%    second
  11002. -------
  11003. IntTime%     time compressed into an integer
  11004.  
  11005. Name  : Time2Sec&            (Time to Seconds)
  11006. Class : Time
  11007. Level : Any
  11008.  
  11009. This routine converts a time string into the number of seconds
  11010. past midnight. This is convenient if you want to find the
  11011. difference between two times or to calculate what time it will
  11012. be after a given interval.
  11013.  
  11014.    Seconds& = Time2Sec&(TimeSt$)
  11015.  
  11016. TimeSt$    time string (TIME$ format)
  11017. -------
  11018. Seconds&   number of seconds past midnight
  11019.  
  11020. Name  : TimeN2S              (Time Numbers to String)
  11021. Class : Time
  11022. Level : Any / DOS
  11023.  
  11024. Many of the PBClone routines return the time as a set of
  11025. numbers.  This routine provides an easy way to convert those
  11026. numbers into string form.  The time format used (whether
  11027. seconds are included) will be based on the length of the string
  11028. which you pass to the routine.  For instance, a string like
  11029. "xx:xx" would return a time like "21:35", whereas "xx:xx:xx"
  11030. would return "21:35:08".
  11031.  
  11032.    TimeSt$ = "xx:xx:xx"
  11033.    TimeN2S HourNr%, MinuteNr%, SecondNr%, TimeSt$
  11034.  
  11035. HourNr%     hour (0-23)
  11036. MinuteNr%   minute
  11037. SecondNr%   second
  11038. -------
  11039. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  11040.  
  11041. Name  : TimeS2N              (Time String to Numbers)
  11042. Class : Time
  11043. Level : Any
  11044.  
  11045. Many of the PBClone routines need to be passed the time as a
  11046. set of numbers. This routine provides an easy way to convert a
  11047. time from string form into numbers.  You may use either
  11048. "xx:xx:xx" or "xx:xx" form to specify the time (the string
  11049. length is important, but the delimiter and contents of the
  11050. string are ignored).  If the 5-character short form is used,
  11051. the Second% value will be zero.
  11052.  
  11053.    TimeS2N HourNr%, MinuteNr%, SecondNr%, TimeSt$
  11054.  
  11055. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  11056. -------
  11057. HourNr%     hour (0-23)
  11058. MinuteNr%   minute
  11059. SecondNr%   second (0 if 5-char format)
  11060.  
  11061. Name  : TInstr               (Typed INSTR)
  11062. Class : String
  11063. Level : Any
  11064.  
  11065. As you might guess from the "Instr" part of the name, this
  11066. routine searches a string.  Instead of searching for a specific
  11067. character or substring, though, it looks for a specific type of
  11068. character-- letters, numbers, control codes, or whatever.  You
  11069. can search for the first of a combination of types, too, which
  11070. also allows searching for "anything but" a specific type.
  11071.  
  11072. The character type code is specified by adding any of the
  11073. following:
  11074.  
  11075.     1    alphabetic
  11076.     2    numeric
  11077.     4    symbolic
  11078.     8    control
  11079.    16    graphics
  11080.    32    space
  11081.  
  11082. The TInstr routine is handy for parsing and cleaning up user
  11083. input, among other uses.
  11084.  
  11085.    TInstr St$, ChrType%, Place%
  11086.  
  11087. St$          string to search
  11088. ChrType%     type of character(s) to search for
  11089. -------
  11090. Place%       position of first char of desired type, or 0
  11091.  
  11092. Name  : ToPostal$            (To Postal Abbreviation)
  11093. Class : String
  11094. Level : Any
  11095.  
  11096. This function returns the two-letter U.S. postal abbreviation
  11097. corresponding to a given place name.  It handles all valid
  11098. abbreviations, including states (e.g., "AZ" = "Arizona") and a
  11099. number of other countries (e.g., "PR" = "Puerto Rico").
  11100.  
  11101. A null string ("") is returned if the specified place can't be
  11102. abbreviated.  Capitalization is not important, but spelling is.
  11103. This function is best used with validated input.  If you have
  11104. control of the input method, consider using a "pick list" menu.
  11105. Otherwise, a fuzzy scanner would be appropriate, using perhaps
  11106. the Bickel and/or Soundex routines to find the closest match if
  11107. a perfect match is not found.
  11108.  
  11109. The conversion can also be done the other way around-- see the
  11110. FromPostal$ function.
  11111.  
  11112.    Abbrev$ = ToPostal$(PlaceName$)
  11113.  
  11114. PlaceName$   place name to abbreviate
  11115. -------
  11116. Abbrev$      two-letter postal abbreviation
  11117.  
  11118. Name  : TVIdle               (TopView Idle)
  11119. Class : Miscellaneous
  11120. Level : BIOS
  11121.  
  11122. If your program is running under TopView or a compatible
  11123. multitasker, such as DESQview, it can take advantage of this
  11124. routine to give up the rest of its time slice.  This would
  11125. normally done at a point where the program is liable to be idle
  11126. for a brief while, such as during user input.
  11127.  
  11128. The advantage of giving up part of your program's time when you
  11129. can afford it is that any other running programs will be able
  11130. to make use of it, hence improving overall system performance.
  11131.  
  11132.    TVIdle
  11133.  
  11134. Name  : TypeIn               (Type In)
  11135. Class : Input
  11136. Level : Clone
  11137.  
  11138. This is an unusual routine which combines both output and
  11139. input.  It sends a string to the keyboard buffer, where it acts
  11140. as if it had been typed in by someone.  The string may be up to
  11141. 15 key codes in length (anything past 15 keys will be ignored,
  11142. due to the limited length of the keyboard buffer).
  11143.  
  11144. Normal keys can be put into the string simply as characters.
  11145. Extended keys, like Alt-key combinations, arrow keys, and
  11146. function keys, must be encoded as CHR$(0) + CHR$(ScanCode),
  11147. where the ScanCode is the key's scan code.  You can look up
  11148. such scan codes in your BASIC manual or use GetKey to find out
  11149. what they are.  Extended keys, although apparently taking up
  11150. two characters, only take up one space in the keyboard buffer.
  11151. The TypeIn routine allows for this fact.
  11152.  
  11153. Among other things, this routine can be used to provide default
  11154. answers to input routines, or to execute another program once
  11155. your program exits.
  11156.  
  11157.    TypeIn St$
  11158.  
  11159. St$     keys to be "typed" into the keyboard buffer
  11160.  
  11161. Name  : TypePrint            (Type Print)
  11162. Class : Display
  11163. Level : Clone
  11164.  
  11165. TypePrint displays a string as if it was being typed.  The
  11166. string is displayed a character at a time, with a delay between
  11167. each character.  You may choose one color to highlight the
  11168. just-displayed character and another color for the character to
  11169. turn after the delay is done.
  11170.  
  11171.    TypePrint St$, Row%, Column%, WaitTime%, TmpAttr%, _
  11172.       VAttr%, Fast%
  11173.  
  11174. St$        string to display
  11175. Row%       row at which to display string
  11176. Column%    column at which to display string
  11177. WaitTime%  delay between chars (milliseconds; 20-60 is decent)
  11178. TmpAttr%   color/attribute for just-displayed character
  11179. VAttr%     color/attribute for character after the delay is up
  11180. Fast%      whether to use fast displays (0 no)
  11181.  
  11182. Name  : UnCalcAttr           (Undo Calculated Attribute)
  11183. Class : Display
  11184. Level : Any
  11185.  
  11186. Many of the display routines in this library require an
  11187. "attribute" rather than foreground and background colors.  An
  11188. attribute is a combination of the foreground and background
  11189. colors in a format which is used by all types of displays when
  11190. in text mode.  The UnCalcAttr routine allows you to decode the
  11191. original colors given the attribute.
  11192.  
  11193. Foreground colors are usually specified as 0-31, with
  11194. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  11195. may be more convenient to express the same thing as foreground
  11196. 0-15, background 0-15.  The CalcAttr routine will accept either
  11197. way of expressing it.
  11198.  
  11199. Note, however, that UnCalcAttr will always return the former
  11200. pair of results, since it has no way of knowing whether Blink
  11201. has been used (foreground 0-31, background 0-15).  The below
  11202. routine shows how to get around this, if needed.
  11203.  
  11204.    UnCalcAttr Foreground%, Background%, VAttr%
  11205.    ' the following is optional and may not be desired...
  11206.    ' it converts colors to "no blink" equivalents (see above)
  11207.    IF Foreground% AND 16 THEN
  11208.       Foreground% = Foreground% - 16
  11209.       Background% = Background% + 8
  11210.    END IF
  11211.  
  11212. VAttr%        color "attribute"
  11213. -------
  11214. Foreground%   foreground color
  11215. Background%   background color
  11216.  
  11217. Name  : UnSCrunch            (Undo Screen Crunch)
  11218. Class : Display
  11219. Level : Any
  11220.  
  11221. This routine is designed to be used in conjunction with ScrRest
  11222. and the other routines which restore an entire 80x25 text
  11223. screen from an array.  It expands screens that were compressed
  11224. by SCrunch to their full original size. The uncompression
  11225. algorithm is very fast and will not take any noticeable amount
  11226. of time for most purposes.
  11227.  
  11228. If your original screen was not 80x25 in size, use the
  11229. UnSCrunchSS routine instead.
  11230.  
  11231.    REDIM FullScreen%(1 TO 2000)
  11232.    DSeg% = VARSEG(FullScreen%(1))
  11233.    DOfs% = VARPTR(FullScreen%(1))
  11234.    UnSCrunch DSeg%, DOfs%, CSeg%, COfs%
  11235.  
  11236. DSeg%     segment of array in which to store expanded image
  11237. DOfs%     offset of array in which to store expanded image
  11238. CSeg%     segment of the compressed image
  11239. COfs%     offset of the compressed image
  11240.  
  11241. Name  : UnSCrunchSS          (Undo Screen Crunch Sized Screen)
  11242. Class : Display
  11243. Level : Any
  11244.  
  11245. This routine is designed to be used in conjunction with ScrRest
  11246. and the other routines which restore a text screen from an
  11247. array.  It expands screens that were compressed by SCrunchSS or
  11248. SCrunch to their full original size.  The uncompression
  11249. algorithm is very fast and will not take any noticeable amount
  11250. of time for most purposes.
  11251.  
  11252. If your original screen was 80x25 in size, you may find it
  11253. convenient to use the UnSCrunch routine instead.
  11254.  
  11255.    REDIM FullScreen%(1 TO Rows% * Cols%)
  11256.    DSeg% = VARSEG(FullScreen%(1))
  11257.    DOfs% = VARPTR(FullScreen%(1))
  11258.    UnSCrunchSS DSeg%, DOfs%, Rows%, Cols%, CSeg%, COfs%
  11259.  
  11260. DSeg%     segment of array in which to store expanded image
  11261. DOfs%     offset of array in which to store expanded image
  11262. Rows%     rows in image
  11263. Cols%     columns in image
  11264. CSeg%     segment of the compressed image
  11265. COfs%     offset of the compressed image
  11266.  
  11267. Name  : UnSplit              (Undo Split)
  11268. Class : Display
  11269. Level : Clone
  11270.  
  11271. This routine does the opposite of Split-- instead of clearing
  11272. the screen by scrolling it in different directions, it puts
  11273. text on the screen by scrolling it on from different
  11274. locations.  The effect is quite stunning.
  11275.  
  11276. The information to place on the screen comes from an array that
  11277. you specify which contains a saved screen.  Only 80x25 text
  11278. modes are supported.  Any of the screen save routines (e.g.,
  11279. ScrSave) may be used to load the array.  In a typical case, you
  11280. will use this routine with screens that were created in advance
  11281. and stored to disk for use by your program.
  11282.  
  11283.    UnSplit Scrn%(), Fast%
  11284.  
  11285. Scrn%()   array containing the text to display
  11286. Fast%     whether to use fast mode (0 no)
  11287.  
  11288. Name  : Upcase               (Uppercase)
  11289. Class : String
  11290. Level : Any
  11291.  
  11292. This routine, like BASIC's UCASE$ function, converts a string
  11293. to uppercase. Since it doesn't have to create a new return
  11294. string (a fairly slow process), it's faster than the BASIC
  11295. equivalent.
  11296.  
  11297. The Upcase routine is designed for the U.S. character set.  If
  11298. your program is intended for distribution, you would be well
  11299. advised to use Upcase1 instead, as it supports international
  11300. character sets.
  11301.  
  11302.    Upcase St$
  11303.  
  11304. St$     string to be capitalized
  11305. -------
  11306. St$     capitalized string
  11307.  
  11308. Name  : Upcase1              (Uppercase)
  11309. Class : String
  11310. Level : DOS
  11311.  
  11312. This routine, like BASIC's UCASE$ function, converts a string
  11313. to uppercase. It converts letters in the extended character set
  11314. as well as the usual letters, making it well suited for text
  11315. which may not be in English.
  11316.  
  11317. Note that DOS 5.0 is required for optimal performance.  With
  11318. older DOS versions, this routine makes assumptions about the
  11319. character set which may not be appropriate.
  11320.  
  11321.    Upcase1 St$
  11322.  
  11323. St$     string to be capitalized
  11324. -------
  11325. St$     capitalized string
  11326.  
  11327. Name  : UpcaseI%             (Uppercase Integer char)
  11328. Class : Numeric
  11329. Level : Any
  11330.  
  11331. This function converts a character to uppercase.  Rather than
  11332. taking a string parameter, though, UpcaseI% works on an integer
  11333. which contains an ASCII code.
  11334.  
  11335. The UpcaseI% function is designed for the U.S. character set.
  11336. If your program is intended for distribution, you would be well
  11337. advised to use UpcaseI1% instead, as it supports international
  11338. character sets.
  11339.  
  11340.    CapCh% = UpcaseI%(Ch%)
  11341.  
  11342. Ch%      character to be capitalized
  11343. -------
  11344. CapCh%   capitalized character
  11345.  
  11346. Name  : UpcaseI1%            (Uppercase Integer char)
  11347. Class : Numeric
  11348. Level : DOS
  11349.  
  11350. This function converts a character to uppercase.  Rather than
  11351. taking a string parameter, though, UpcaseI% works on an integer
  11352. which contains an ASCII code.
  11353.  
  11354. Note that DOS 5.0 is required for optimal performance.  With
  11355. older DOS versions, this routine makes assumptions about the
  11356. character set which may not be appropriate.
  11357.  
  11358.    CapCh% = UpcaseI1%(Ch%)
  11359.  
  11360. Ch%      character to be capitalized
  11361. -------
  11362. CapCh%   capitalized character
  11363.  
  11364. Name  : UpdTVScreen          (Update TopView Screen)
  11365. Class : Display
  11366. Level : BIOS
  11367.  
  11368. UpdTVScreen tells a TopView-compatible multitasker to update
  11369. the screen using a specified screen buffer (use GetTVScreen to
  11370. get the buffer location).  Some multitaskers will do this
  11371. automatically, but some won't.  It's safe to use this routine
  11372. either way.
  11373.  
  11374. See also GetDView, GetTView, GetTVScreen.
  11375.  
  11376.    UpdTVScreen DSeg%, DOfs%
  11377.  
  11378. DSeg%       segment of screen buffer
  11379. DOfs%       offset of screen buffer
  11380.  
  11381. Name  : VGARest13            (VGA Restore for SCREEN 13)
  11382. Class : Display
  11383. Level : Clone
  11384.  
  11385. This routine allows you to restore a SCREEN 13 (VGA, 320x200,
  11386. 256 color) display that was saved using VGASave13 (see).
  11387.  
  11388.    VGARest13 DSeg%, DOfs%
  11389.  
  11390. DSeg%        segment of storage array, returned by VARSEG
  11391. DOfs%        offset  of storage array, returned by VARPTR
  11392.  
  11393. Name  : VGASave13            (VGA Save of SCREEN 13)
  11394. Class : Display
  11395. Level : Clone
  11396.  
  11397. This routine allows you to save a SCREEN 13 (VGA, 320x200, 256
  11398. color) display that can be restored using VGARest13 (see).
  11399.  
  11400. The array used to hold the screen must contain 64,000 bytes.
  11401. For an integer array, this means that you must create the array
  11402. by DIM Array%(1 TO 32000).
  11403.  
  11404.    VGASave13 DSeg%, DOfs%
  11405.  
  11406. DSeg%        segment of storage array, returned by VARSEG
  11407. DOfs%        offset  of storage array, returned by VARPTR
  11408.  
  11409. Name  : WeekDay0             (Week Day)
  11410. Class : Time
  11411. Level : DOS
  11412.  
  11413. This routine tells you what the day of the week is, just the
  11414. thing for calendar programs and whatnot.  The day is returned
  11415. as a number from 1-7, which identifies a day from Sunday
  11416. through Saturday.
  11417.  
  11418.    WeekDay0 DayNr%
  11419.  
  11420. -------
  11421. DayNr%     current day
  11422.  
  11423. Name  : WeekDay1             (Week Day)
  11424. Class : Time
  11425. Level : Any
  11426.  
  11427. This routine tells you the day of the week for any given date.
  11428.  
  11429.    WeekDay1 MonthNr%, DayNr%, YearNr%, DayName$
  11430.  
  11431. MonthNr%     month number (1-12)
  11432. DayNr%       day number (1-31)
  11433. YearNr%      year number (1900 on)
  11434. -------
  11435. DayName$     day of the week
  11436.  
  11437. Name  : WinCheck             (Windows Check)
  11438. Class : Equipment
  11439. Level : BIOS
  11440.  
  11441. The WinCheck routine tells you what version of Microsoft
  11442. Windows is in use, if any.  It returns the results as two
  11443. integers containing the major and minor version numbers.  For
  11444. instance, Windows 3.0 would return a major number of 3, minor
  11445. 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  11446. not running, 0.0 will be returned.  NOTE that this routine is
  11447. not able to detect Windows 1.x versions!
  11448.  
  11449.    WinCheck MajorV%, MinorV%
  11450.  
  11451. -------
  11452. MajorV%   major part of the Windows version
  11453. MinorV%   minor part of the Windows version
  11454.  
  11455. Name  : WindowMan2           (Window Manager)
  11456. Class : Display
  11457. Level : Clone
  11458.  
  11459. This routine is identical to WindowManager but for the fact
  11460. that it allows you to design your own custom window frames.
  11461. Please see the description of WindowManager for general
  11462. information.
  11463.  
  11464. These are the additional frame types:
  11465.     6   custom frame composed of a single character
  11466.     7   custom frame composed of the specified 7-character list:
  11467.         top left corner, top middle, top right corner,
  11468.         left middle, right middle,
  11469.         bottom left corner, bottom middle, bottom right corner
  11470.  
  11471.  /------------------------------------------------------------\
  11472.  | A custom frame like this would be defined as frame type 7, |
  11473.  | with a frame string of "/-\||\-/", for instance.           |
  11474.  \------------------------------------------------------------/
  11475.  
  11476.  *************************************************
  11477.  * On the other hand, a frame like this would be *
  11478.  * frame type 6, with a frame string of "*".     *
  11479.  *************************************************
  11480.  
  11481. Note that this routine differs from the ProBas equivalent in
  11482. that it supports full frame definitions through frame type 7
  11483. (ProBas only supports type 6). The other differences mentioned
  11484. under WindowManager are also relevant.
  11485.  
  11486.    WindowMan2 TRow%, LCol%, BRow%, RCol%, Frame%, FSt$,
  11487.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  11488.  
  11489. TRow%       top row of window
  11490. LCol%       left column of window
  11491. BRow%       bottom row of window
  11492. RCol%       right column of window
  11493. Frame%      frame type (see above)
  11494. FSt$        frame definition string (see above)
  11495. Fore%       frame foreground color
  11496. Back%       frame background color
  11497. Grow%       window growing option (see above)
  11498. Shade%      window shadow option (see above)
  11499. TFore%      title foreground color
  11500. Title$      window title ("" if none)
  11501. Page%       display page (normally zero)
  11502. Fast%       whether to use fast mode (0 no)
  11503.  
  11504. Name  : WindowMan3           (Window Manager)
  11505. Class : Display
  11506. Level : Clone
  11507.  
  11508. This routine is identical in function to WindowManager.  The
  11509. parameters are mostly passed as an array, however, instead of
  11510. one by one.  Please see the description of WindowManager for
  11511. general information.
  11512.  
  11513.    WindowMan3 Parm%(), Title$
  11514.  
  11515. Parm%(1)    top row of window
  11516. Parm%(2)    left column of window
  11517. Parm%(3)    bottom row of window
  11518. Parm%(4)    right column of window
  11519. Parm%(5)    frame type (see above)
  11520. Parm%(6)    frame foreground color
  11521. Parm%(7)    frame background color
  11522. Parm%(8)    window growing option (see above)
  11523. Parm%(9)    window shadow option (see above)
  11524. Parm%(10)   title foreground color
  11525. Parm%(11)   display page (normally zero)
  11526. Parm%(12)   whether to use fast mode (0 no)
  11527. Title$      window title ("" if none)
  11528.  
  11529. Name  : WindowMan4           (Window Manager)
  11530. Class : Display
  11531. Level : Clone
  11532.  
  11533. This is an extremely cut-down version of WindowManager,
  11534. providing no more than a simple frame generator.
  11535.  
  11536. These are the available frame types:
  11537.     0   no frame
  11538.     1   single lines
  11539.     2   double lines
  11540.     3   single horizontal, double vertical lines
  11541.     4   double horizontal, single vertical lines
  11542.     5   block graphic lines
  11543.  
  11544. Note that this routine is different from its ProBas equivalent
  11545. in that a new frame type (5) is available.
  11546.  
  11547.    WindowMan4 TRow%, LCol%, BRow%, RCol%, Frame%, VAttr%, _
  11548.       Page%, Fast%
  11549.  
  11550. TRow%       top row of window
  11551. LCol%       left column of window
  11552. BRow%       bottom row of window
  11553. RCol%       right column of window
  11554. Frame%      frame type (see above)
  11555. VAttr%      frame color/attribute (use CalcAttr)
  11556. Page%       display page (normally zero)
  11557. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  11558.  
  11559. Name  : WindowManager        (Window Manager)
  11560. Class : Display
  11561. Level : Clone
  11562.  
  11563. WindowManager displays a pop-up window according to your
  11564. specifications.  The window may have any of a variety of
  11565. frames, a title, or a shadow, and it may appear instantly or
  11566. "grow" onto the screen.  Only text mode is supported.
  11567.  
  11568. These are the available frame types:
  11569.     0   no frame
  11570.     1   single lines
  11571.     2   double lines
  11572.     3   single horizontal, double vertical lines
  11573.     4   double horizontal, single vertical lines
  11574.     5   block graphic lines
  11575.  
  11576. These are the available shadows:
  11577.    -3   transparent shadow on the right
  11578.    -2   transparent shadow on the left
  11579.    -1   solid black shadow on the left
  11580.     0   no shadow
  11581.    1+   shadow attribute (use CalcAttr) for a colored shadow
  11582.  
  11583. Options for growing windows are as follows:
  11584.    -1   grow as fast as possible
  11585.     0   pop onto the screen
  11586.    1+   grow with delay given in milliseconds (15 works for me)
  11587.  
  11588. Note that this routine is different from its ProBas equivalent
  11589. in a number of respects.  The grow delay time is different.
  11590. Growing is done more smoothly. The shadow and title parameters
  11591. are not changed by this routine.  A new frame type (5) was
  11592. added.  If a title is too long, it is truncated instead of
  11593. being ignored completely.  Using a -1 as the title foreground
  11594. color will not turn off the title; instead, use a null title
  11595. string.
  11596.  
  11597.    WindowManager TRow%, LCol%, BRow%, RCol%, Frame%,
  11598.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  11599.  
  11600. TRow%       top row of window
  11601. LCol%       left column of window
  11602. BRow%       bottom row of window
  11603. RCol%       right column of window
  11604. Frame%      frame type (see above)
  11605. Fore%       frame foreground color
  11606. Back%       frame background color
  11607. Grow%       window growing option (see above)
  11608. Shade%      window shadow option (see above)
  11609. TFore%      title foreground color
  11610. Title$      window title ("" if none)
  11611. Page%       display page (normally zero)
  11612. Fast%       whether to use fast mode (0 no)
  11613.  
  11614. Name  : WriteBitF            (Write Bit Field)
  11615. Class : Numeric
  11616. Level : Any
  11617.  
  11618. This routine allows you to set an element of a virtual array.
  11619. The actual array can be any numeric type, as it is just being
  11620. used as a storage area. The virtual array is composed of
  11621. numbers of a bit length that you specify (1-8).  This provides
  11622. efficient storage for numbers which have a limited range.
  11623.  
  11624. Here's how you DIM the actual array, assuming an integer array
  11625. is used:
  11626.    DIM Array%(1 TO (VirtElements * VirtBits + 15) \ 16)
  11627.  
  11628. "VirtElements" is the number of elements in the virtual array
  11629. and "VirtBits" is the number of bits per element.
  11630.  
  11631. See also ReadBitF.
  11632.  
  11633.    WriteBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  11634.  
  11635. DSeg%        segment of actual array
  11636. DOfs%        offset of actual array
  11637. ElementNr&   virtual element number (starts at 0)
  11638. BitLen%      bits per virtual element (1-8)
  11639. Value%       value to set element to (range depends on BitLen%)
  11640.  
  11641. Name  : Xlate                (Translate)
  11642. Class : String
  11643. Level : Any
  11644.  
  11645. The Xlate routine allows for translating a string, character by
  11646. character, very quickly.  It uses a translation table that you
  11647. provide.  This table is 256 bytes long, one byte for each
  11648. character in the ASCII table.  The translation is done by
  11649. position-- for instance, if the original character was "A"
  11650. (ASCII 65), the translated character will be whatever is in the
  11651. translation table at position 66.  Why 66, when "A" is 65?
  11652. Because ASCII runs from 0-255, but the translation string is
  11653. 1-256: everything is one higher in the string than the ASCII
  11654. character it represents.
  11655.  
  11656. Translation capabilities are handy in communications software.
  11657. They can also be used in other things.  One simple use would be
  11658. to set up a translation table where all lowercase characters
  11659. would be converted to uppercase.  You might ask why, since
  11660. BASIC has a UCASE$ function and PBClone has an Upcase routine.
  11661. Well, Upcase is faster than UCASE$, since it doesn't have to
  11662. create a return string; but Xlate would be even faster, since
  11663. it translates every character directly instead of deciding
  11664. whether it's a lowercase letter!
  11665.  
  11666. Simple encoding, WordStar file decryption, string reversal,
  11667. uppercase / lowercase conversion, and many other things can be
  11668. done with Xlate.
  11669.  
  11670. Remember to initialize all 256 characters in the translation
  11671. table!
  11672.  
  11673.    Xlate St$, XlateTable$
  11674.  
  11675. St$          string to translate
  11676. XlateTable$  translation table
  11677. -------
  11678. St$          translated string
  11679.  
  11680. Name  : XMPrint              (Translate and MS-DOS Print)
  11681. Class : Display
  11682. Level : DOS
  11683.  
  11684. A combination of the Xlate and DMPrint routines, this 'un
  11685. allows you to display using DOS services while being able to
  11686. translate or screen out characters.  Each character of the
  11687. string to display is passed through a translation table you
  11688. provide (256 bytes, where each position corresponds directly to
  11689. the ASCII code of the same number [0-255]).  If the result is
  11690. 0, the character is not displayed.  Otherwise, the translated
  11691. character is displayed using DOS display services.  The new
  11692. cursor position is returned so you can inform BASIC about it.
  11693.  
  11694. Note that the new cursor position may not be accurate!  Some
  11695. ANSI drivers do not update the BIOS cursor position info, in
  11696. which case the results won't be useful.  That's a hazard of
  11697. using DOS output.
  11698.  
  11699.    XMPrint St$, XlateTable$, Row%, Column%
  11700.    LOCATE Row%, Column%
  11701.  
  11702. St$          string to display
  11703. XlateTable$  translation table
  11704. -------
  11705. Row%         current row
  11706. Column%      current column
  11707.  
  11708. Name  : XorSt                (XOR String)
  11709. Class : String
  11710. Level : Any
  11711.  
  11712. This routine XORs each byte in one string with the
  11713. corresponding byte in a second string.  The strings must be the
  11714. same length.
  11715.  
  11716.    XorSt St1$, St2$
  11717.  
  11718. St1$      string to XOR
  11719. St2$      string to XOR with
  11720. -------
  11721. St1$      result
  11722.  
  11723. Name  : XQPrint              (Extended Quick Print)
  11724. Class : Display
  11725. Level : Clone
  11726.  
  11727. This routine provides a rather crude, but very fast, display
  11728. capability.  It works like the PRINT statement in BASIC, except
  11729. that it doesn't move the cursor or process control codes.  It
  11730. works only in text modes.
  11731.  
  11732. See also QPrint, a slightly less flexible (but even faster)
  11733. routine.
  11734.  
  11735.    XQPrint St$, Row%, Column%, VAttr%, Page%, Fast%
  11736.  
  11737. St$       string to display
  11738. Row%      starting row
  11739. Column%   starting column
  11740. VAttr%    color/attribute (see CalcAttr)
  11741. Page%     display page (unused on MDA/Herc; normally 0)
  11742. Fast%     whether to use fast mode (0 no)
  11743.  
  11744. Name  : XQPrintOver          (Extended Quick Print Overwrite)
  11745. Class : Display
  11746. Level : Clone
  11747.  
  11748. This routine provides a rather crude, but very fast, display
  11749. capability.  It works like the PRINT statement in BASIC, except
  11750. that it doesn't move the cursor or process control codes.  It
  11751. works only in text modes.
  11752.  
  11753. This is a slightly unusual variant on a print routine.  It
  11754. displays all characters except spaces.  If your string contains
  11755. a space, that position on the screen will be skipped.  In other
  11756. words, it acts kind of like an overlay. This can be handy when
  11757. you have text in alternating colors.
  11758.  
  11759. I came up with this routine when I designed a program with a
  11760. function key display at the bottom of the screen-- the names of
  11761. the function keys were one color and the associated definitions
  11762. were another color.  It was obvious that the easiest way of
  11763. handling that would be to use an "overlay" approach.  The
  11764. function key definitions were laid down with XQPrint.  I then
  11765. overlaid the line with the function key names in a different
  11766. color, using XQPrintOver.
  11767.  
  11768. If you need a "solid" space, rather than a "transparent" space,
  11769. use CHR$(255) instead of CHR$(32).
  11770.  
  11771.    XQPrintOver St$, Row%, Column%, VAttr%, Page%, Fast%
  11772.  
  11773. St$       string to display
  11774. Row%      starting row
  11775. Column%   starting column
  11776. VAttr%    color/attribute (see CalcAttr)
  11777. Page%     display page (unused on MDA/Herc; normally 0)
  11778. Fast%     whether to use fast mode (0 no)
  11779.  
  11780.